CollectorSink extends EventSink.Base { public static SinkBuilder builder() { return new SinkBuilder() { @Override public EventSink build(Context context, String... argv) { Preconditions.checkArgument(argv.length <= 2 && argv.length >= 0, "usage: collector[(rollmillis)] { subsink }"); String snkSpec = argv[0]; long millis = FlumeConfiguration.get().getCollectorRollMillis(); if (argv.length >= 2) { millis = Long.parseLong(argv[1]); } try { EventSink deco = new CollectorSink(context, snkSpec, millis, FlumeNode.getInstance().getCollectorAckListener()); return deco; } catch (FlumeSpecException e) { LOG.error("CollectorDecorator spec error " + e, e); throw new IllegalArgumentException( "usage: collector[(rollmillis)] { subsink }" + e); } } }; } CollectorSink(Context ctx, String snkSpec, long millis, AckListener ackDest);   CollectorSink(Context ctx, final String snkSpec, final long millis,
      final Tagger tagger, long checkmillis, AckListener ackDest);   CollectorSink(Context ctx, String path, String filename, long millis,
      final Tagger tagger, long checkmillis, AckListener ackDest); @Override void append(Event e); @Override void close(); @Override void open(); @Override String getName(); @Override ReportEvent getMetrics(); @Override Map<String, Reportable> getSubMetrics(); @Deprecated @Override void getReports(String namePrefix, Map<String, ReportEvent> reports); EventSink getSink(); static SinkBuilder builder(); static SinkBuilder hdfsBuilder();  }
@Test public void testBuilder() throws FlumeSpecException { Exception ex = null; try { String src = "collectorSink"; FlumeBuilder.buildSink(new Context(), src); } catch (Exception e) { return; } assertNotNull("No exception thrown!", ex != null); String src2 = "collectorSink(\"file: FlumeBuilder.buildSink(new Context(), src2); String src3 = "collectorSink(\"file: FlumeBuilder.buildSink(new Context(), src3); String src4 = "collectorSink(\"file: FlumeBuilder.buildSink(new Context(), src4); src4 = "collectorSink(\"file: FlumeBuilder.buildSink(new Context(), src4); src4 = "collectorSink(\"file: FlumeBuilder.buildSink(new Context(), src4); }