Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.EventSink.open()


    // max 5s, backoff initially at 10ms
    BackoffPolicy bop = new CappedExponentialBackoff(10, 5000);
    final InsistentOpenDecorator<EventSink> insistent = new InsistentOpenDecorator<EventSink>(
        fail4eva, bop);
    final EventSink sink = new LazyOpenDecorator<EventSink>(insistent);
    sink.open();

    // create an endless stream of data
    final EventSource source = new LazyOpenSource<EventSource>(
        new NoNlASCIISynthSource(0, 100));
    source.open();
View Full Code Here


    for (Entry<String, Pair<EventSource, EventSink>> e : cfg.entrySet()) {
      // String name = e.getKey();
      EventSource src = e.getValue().getLeft();
      EventSink snk = e.getValue().getRight();
      src.open();
      snk.open();
      EventUtil.dumpAll(src, snk);
      src.close();
      snk.close();
    }
    AccumulatorSink cnt = (AccumulatorSink) ReportManager.get().getReportable(
View Full Code Here

    // max 5s, backoff initially at 10ms
    BackoffPolicy bop = new CappedExponentialBackoff(10, 5000);
    final EventSink insistent = new InsistentAppendDecorator<EventSink>(
        fail4eva, bop);
    final EventSink sink = new LazyOpenDecorator<EventSink>(insistent);
    sink.open();

    // create an endless stream of data
    final EventSource source = new EventSource.Base() {
      @Override
      public Event next() {
View Full Code Here

      @Override
      public EventSink newSink(Context ctx) throws IOException {
        return sink;
      }
    };
    roll.open();

    // create an endless stream of data
    final EventSource source = new EventSource.Base() {
      @Override
      public Event next() {
View Full Code Here

    final StubbornAppendSink<EventSink> stubborn = new StubbornAppendSink<EventSink>(
        insistent);
    final InsistentAppendDecorator<EventSink> append = new InsistentAppendDecorator<EventSink>(
        stubborn, new CappedExponentialBackoff(100, 100000));
    final EventSink sink = new LazyOpenDecorator<EventSink>(append);
    sink.open();

    // create an endless stream of data
    final EventSource source = new LazyOpenSource<EventSource>(
        new NoNlASCIISynthSource(0, 100));
    source.open();
View Full Code Here

    wal.open();

    // get a sink write to it and then be done with it.
    Tagger t = new ProcessTagger();
    EventSink sink = wal.newWritingSink(t);
    sink.open();
    sink.append(new EventImpl("foo".getBytes()));
    assertEquals(1, wal.getWritingTags().size());

    // close moves to logged state.
    sink.close();
View Full Code Here

    c2Src.open();

    // create agentBEChain sink
    String spec = "agentBEChain(\"localhost:1234\", \"localhost:1235\")";
    EventSink snk = new CompositeSink(new Context(), spec);
    snk.open();

    Event e1 = new EventImpl("test 1".getBytes());
    Event e2 = new EventImpl("test 2".getBytes());
    Event e3 = new EventImpl("test 3".getBytes());
    Event e4 = new EventImpl("test 4".getBytes());
View Full Code Here

  @Test
  public void testBuildConsole() throws IOException, FlumeSpecException,
      InterruptedException {
    EventSink snk = fact.getSink(new Context(), "console");
    snk.open();
    snk.append(new EventImpl("test".getBytes()));
    snk.close();
  }

  @Test
View Full Code Here

  public void testConnector() throws IOException, InterruptedException,
      FlumeSpecException {
    Context ctx = LogicalNodeContext.testingContext();

    EventSink snk = fact.getSink(ctx, "console");
    snk.open();

    EventSource src = srcfact.getSource(ctx, "asciisynth", "25", "100");
    src.open();

    DirectDriver conn = new DirectDriver(src, snk);
View Full Code Here

    EventSinkDecorator<EventSink> deco =

    fact.getDecorator(new Context(), "intervalSampler", "5");
    EventSink snk = fact.getSink(new Context(), "counter", "name");

    snk.open();

    deco.setSink(snk);
    EventUtil.dumpAll(src, snk);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.