NaiveFileWALDeco extends EventSinkDecorator<EventSink> { public static SinkDecoBuilder builderEndToEndDir() { return new SinkDecoBuilder() { @Override public EventSinkDecorator<EventSink> build(Context context, String... argv) { Preconditions.checkArgument(argv.length <= 3, "usage: ackedWriteAhead[(maxMillis,walnode,checkMs)]"); FlumeConfiguration conf = FlumeConfiguration.get(); long delayMillis = conf.getAgentLogMaxAge(); if (argv.length >= 1) { delayMillis = Long.parseLong(argv[0]); } FlumeNode node = FlumeNode.getInstance(); String walnode = context.getValue(LogicalNodeContext.C_LOGICAL); if (argv.length >= 2) { walnode = argv[1]; } Preconditions.checkArgument(walnode != null, "Context does not have a logical node name"); long checkMs = 250; if (argv.length >= 3) { checkMs = Long.parseLong(argv[2]); } WALManager walman = node.getAddWALManager(walnode); return new NaiveFileWALDeco(context, null, walman, new TimeTrigger( delayMillis), node.getAckChecker().getAgentAckQueuer(), checkMs); } }; } NaiveFileWALDeco(Context ctx, EventSink s, final WALManager walman,
      RollTrigger t, AckListener al, long checkMs); @Override synchronized void append(Event e); @Override synchronized void close(); @Override synchronized void open(); synchronized void setSink(EventSink sink); synchronized boolean rotate(); boolean isEmpty(); static SinkDecoBuilder builderEndToEndDir(); @Override String getName(); @Deprecated @Override ReportEvent getReport(); @Override ReportEvent getMetrics(); Map<String, Reportable> getSubMetrics();  }
@Test(expected = IllegalArgumentException.class) public void testBadE2eBuilderArgs() { SinkDecoBuilder b = NaiveFileWALDeco.builderEndToEndDir(); b.build(LogicalNodeContext.testingContext(), "foo", "bar"); }