Review Board 1.7.22


Tools to generate configuration file

Review Request #6206 - Created July 30, 2012 and updated

Denny Ye
trunk,
FLUME-1405
Reviewers
Flume
brocknoland
Flume
Here is the tool for generating Flume configuration file with Java code. 
Test example:

Agent agent = new Agent().setName("agent");

Source source = new Source("scribe")
                .setProperty("port", "1499")
                .setType(SourceType.OTHER,"org.apache.flume.source.scribe.ScribeSource");

agent.registerSource(source);

for (int i = 0; i < 5; i++) {
  Channel channel = new Channel("mc" + i)
                .setProperty("capacity", "1000000")
                .setType(ChannelType.MEMORY, null);

  agent.registerChannel(channel);

  Sink sink = new Sink("hfds" + i)
                .setType(SinkType.HDFS, null)
                .setProperty("hfds.txtEventMax", "1000")
                .setProperty("hdfs.path", "/flume_test/data" + i)
                .connectChannel(channel);

  agent.registerSink(sink);
  source.connectChannel(channel);
}

ConfGenerator.generateConf(agent, new File("XXXXX"));
Total:
1
Open:
1
Resolved:
0
Dropped:
0
Status:
From:
Description From Last Updated Status
probably should be thrown Brock Noland Aug. 9, 2012, 4:23 p.m. Open
Review request changed
Updated (Aug. 6, 2012, 6:56 a.m.)
Find the original bug
Posted (Aug. 9, 2012, 4:23 p.m.)
The formatting is off, can you reformat the patch?  I'd like to get some input from other devs to see if this is useful. Personally I had writing the configuration files so I am inclined to have something like this.
probably should be thrown