GSoC / libConfuse Java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GSoC / libConfuse Java

Daniel Pocock

Hi all,

Zhi An (on CC) is one of the Google Summer of Code students for the
Ganglia project.

He has looked at making a Java parser for libConfuse config files, for
JMXetric to read /etc/ganglia/gmond.conf

Has anybody looked at this in the past?

Are there any other Java libraries that are known to parse libConfuse
format configs?

Would it be OK to contribute this work to the libConfuse Github
repository, so that the C and Java implementations can share the test cases?

Regards,

Daniel


_______________________________________________
Confuse-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: GSoC / libConfuse Java

Chris Burroughs
I had a use for this but was unable to find anything [1].

I ended up with a mess of regexes [2], but would also be happy to swith
to something more proper.

[1]
https://www.mail-archive.com/ganglia-general@.../msg07716.html

[2]
https://github.com/addthis/metrics-reporter-config/blob/master/src/main/java/com/addthis/metrics/reporter/config/GmondConfigParser.java

On 07/01/2014 08:45 AM, Daniel Pocock wrote:

>
> Hi all,
>
> Zhi An (on CC) is one of the Google Summer of Code students for the
> Ganglia project.
>
> He has looked at making a Java parser for libConfuse config files, for
> JMXetric to read /etc/ganglia/gmond.conf
>
> Has anybody looked at this in the past?
>
> Are there any other Java libraries that are known to parse libConfuse
> format configs?
>
> Would it be OK to contribute this work to the libConfuse Github
> repository, so that the C and Java implementations can share the test cases?
>
> Regards,
>
> Daniel
>
>
> _______________________________________________
> Confuse-devel mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/confuse-devel
>


_______________________________________________
Confuse-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/confuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: GSoC / libConfuse Java

Zhi An Ng

Thanks for sharing, I'm thinking of using JavaCC [1] to parse and generate a `Conf' object, which you can query for options. E.g. the configuration file has this:

globals {
  daemonize = yes
  setuid = yes
}

The API will look something like this

Conf gmondConf = Parser.parse(file);
Section globals = gmondConf.getSection("globals");
Option daemonize = globals.getOption("daemonize");
Boolean isDaemonize = daemonize.toBoolean();

However this is different from how libconfuse works. Libconfuse requires you to register each section and options available before parsing, and will return and error when an unknown section is encountered while parsing.

One possible way is to translate libconfuse to Java and add that as a dependency for use in gmetric4j and other projects that uses similar configuration files.

[1] http://javacc.java.net/

Best,
Zhi An

I had a use for this but was unable to find anything [1].

I ended up with a mess of regexes [2], but would also be happy to swith to something more proper.

[1] https://www.mail-archive.com/ganglia-general@lists.sourceforge.net/msg07716.html

[2] https://github.com/addthis/metrics-reporter-config/blob/master/src/main/java/com/addthis/metrics/reporter/config/GmondConfigParser.java

On 07/01/2014 08:45 AM, Daniel Pocock wrote:

Hi all,

Zhi An (on CC) is one of the Google Summer of Code students for the
Ganglia project.

He has looked at making a Java parser for libConfuse config files, for
JMXetric to read /etc/ganglia/gmond.conf

Has anybody looked at this in the past?

Are there any other Java libraries that are known to parse libConfuse
format configs?

Would it be OK to contribute this work to the libConfuse Github
repository, so that the C and Java implementations can share the test cases?

Regards,

Daniel


_______________________________________________
Confuse-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/confuse-devel



_______________________________________________
Confuse-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/confuse-devel