public void testDFOInsistentRetry() throws IOException, RuntimeException,
FlumeSpecException, InterruptedException {
long count = 100;
// start the collectors first
LogicalNode coll = setupColl(12345, "coll", "count");
LogicalNode coll2 = setupColl(12346, "coll2", "count2");
// Then the agent so it can connect. This config will attempt to send on the
// primary, and when if fails goes to writing to disk. The subsink of
// diskFailover is decorated to never return with an exception.
String agentSink = "{ delay(100) => < "
+ "{ flakeyAppend(.05) => rpcSink(\"localhost\",12345) } ?"
+ " {diskFailover => { insistentAppend => { stubbornAppend => { insistentOpen "
+ "=> { lazyOpen => {flakeyAppend(.05) => rpcSink(\"localhost\",12346) } } } } } }> } ";
LogicalNode agent = setupAgent(count, agentSink);
// wait until the counts add up properly
AccumulatorSink ctr = (AccumulatorSink) ReportManager.get().getReportable(
"count");
AccumulatorSink ctr2 = (AccumulatorSink) ReportManager.get().getReportable(
"count2");
loopUntilCount(count, coll, coll2);
// close off the collector
coll.close();
coll2.close();
// dump info for debugging
Map<String, ReportEvent> rpts = new HashMap<String, ReportEvent>();
agent.getReports(rpts);
for (Entry<String, ReportEvent> e : rpts.entrySet()) {
LOG.info(e.getKey() + " : " + e.getValue());
}
// check the end states