Package com.cloudera.flume.core

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


    Context ctx = LogicalNodeContext.testingContext();
    EventSource rpcSrc = srcfact.getSource(ctx, "rpcSource", "31337");
    EventSink rpcSink = fact.getSink(ctx, "rpcSink", "0.0.0.0", "31337");
    // Rpcsrc needs to be started before the Rpcsink can connect to it.
    rpcSrc.open();
    rpcSink.open();

    Thread.sleep(100); // need some time to open the connector.

    EventSink counter = fact.getSink(ctx, "counter", "count");
    EventSource txtsrc = srcfact.getSource(ctx, "asciisynth", "25", "100");
View Full Code Here


    Thread.sleep(100); // need some time to open the connector.

    EventSink counter = fact.getSink(ctx, "counter", "count");
    EventSource txtsrc = srcfact.getSource(ctx, "asciisynth", "25", "100");
    counter.open();
    txtsrc.open();

    DirectDriver svrconn = new DirectDriver(rpcSrc, counter);
    svrconn.start();
View Full Code Here

            // make each parallel instance send a slightly different number of
            // messages.
            EventSource src = new NoNlASCIISynthSource(events + idx, 100);

            src.open();
            snk.open();

            started.countDown();

            EventUtil.dumpAll(src, snk);
            src.close();
View Full Code Here

    File f = FileUtil.mktempdir();

    EventSink snk = new HiveNotifyingDfsSink("file://" + f + "/%Y-%m-%d/",
        "file-%{host}", "hivetable");

    snk.open();
    long day_millis = 1000 * 60 * 60 * 24;
    Event e1 = new EventImpl(new byte[0], Clock.unixTime(), Priority.INFO, 0,
        "localhost");
    Event e2 = new EventImpl(new byte[0], e1.getTimestamp() + day_millis,
        Priority.INFO, 0, "localhost");
View Full Code Here

    System.out.println(spec);
    EventSink snk = new CompositeSink(new ReportTestingContext(), spec);

    LOG.info(snk.getMetrics().toText());

    snk.open();
    EventSource src = MemorySinkSource.cannedData("test is a test", 31);
    src.open();
    EventUtil.dumpAll(src, snk);

    int[] ans = { 16, 8, 4, 2, 1 };
View Full Code Here

        "{ lazyOpen => counter(\"count\") } ");
    CounterSink cnt = (CounterSink) ReportManager.get().getReportable("count");

    boolean ok = false;
    Event e = new EventImpl("event".getBytes());
    snk.open();
    try {
      cnt.append(e);
    } catch (Exception ex) {
      ok = true;
      // should be thrown because not actually open
View Full Code Here

    assertNotNull(rpt.getLongMetric(RollSink.A_ROLLS));
    assertEquals("one", rpt.getStringMetric(RollSink.A_ROLLSPEC));
    assertNull(rpt.getStringMetric("One.name"));

    // need to open to have sub sink show up
    snk.open();

    ReportEvent all = ReportUtil.getFlattenedReport(snk);
    LOG.info(ReportUtil.toJSONObject(all).toString());
    assertNotNull(rpt.getLongMetric(RollSink.A_ROLLFAILS));
    assertNotNull(rpt.getLongMetric(RollSink.A_ROLLS));
View Full Code Here

    assumeTrue(!OSUtils.isWindowsOS());

    SinkBuilder sb = DFSEventSink.builder();
    EventSink snk = sb.build(new Context(), "/foo/msgs");
    try {
      snk.open();
    } catch (IOException e) {
      return;
    }
    fail("expected exception due to perms");
View Full Code Here

    EventSink s1 = new ValueDecorator<EventSink>(mem, "duped",
        "second".getBytes());
    EventSink s2 = new MaskDecorator<EventSink>(s1, "duped");
    EventSink snk = new ValueDecorator<EventSink>(s2, "duped",
        "first".getBytes());
    snk.open();

    Event e = new EventImpl("foo".getBytes());
    snk.append(e);
    snk.close();
View Full Code Here

  public void testRollRollConflict() throws IOException, FlumeSpecException,
      InterruptedException {
    EventSink snk = new CompositeSink(new Context(),
        "{value(\"rolltag\",\"foofoo\") =>   roll(10000) {null} } ");
    Event e = new EventImpl("foo".getBytes());
    snk.open();
    snk.append(e); // should bork.
  }

  @Test(expected = IllegalArgumentException.class)
  public void testRollRollBork() throws IOException, FlumeSpecException, InterruptedException {
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.