Package com.cloudera.flume.core

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


  @Test
  public void testBuilder() throws IOException, InterruptedException {
    EventSink snk = GangliaSink.builder().build(new Context(), "localhost",
        "foo", "int");
    for (int i = 0; i < 10; i++) {
      snk.open();
      snk.append(new EventImpl("".getBytes()));
      snk.close();
    }

    EventSink snk4 = GangliaSink.builder().build(new Context(), "localhost",
View Full Code Here


    }

    EventSink snk4 = GangliaSink.builder().build(new Context(), "localhost",
        "foo", "int", FlumeConfiguration.get().getGangliaServers());
    for (int i = 0; i < 10; i++) {
      snk4.open();
      snk4.append(new EventImpl("".getBytes()));
      snk4.close();
    }

    try {
View Full Code Here

  public void testFactoryBuild() throws FlumeSpecException, IOException,
      InterruptedException {
    EventSink snk = new CompositeSink(new Context(),
        "ganglia(\"localhost\", \"foo\", \"int\")");
    for (int i = 0; i < 10; i++) {
      snk.open();
      snk.append(new EventImpl("".getBytes()));
      snk.close();
    }

  }
View Full Code Here

    LOG.info("Listening to port " + listener.getPort());

    // setup and send some ganglia data.
    EventSink ganglia = new GangliaSink(hostName + ":" + listener.getPort(),
        "foo", "bars", Type.INT);
    ganglia.open();
    Event e = new EventImpl("baz".getBytes());
    Attributes.setInt(e, "foo", 1337);
    ganglia.append(e);
    ganglia.close();
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

  @Test
  public void testBuildConsole() throws IOException, FlumeSpecException,
      InterruptedException {

    EventSink snk = FlumeBuilder.buildSink(new Context(), "console");
    snk.open();
    snk.append(new EventImpl("test".getBytes()));
    snk.close();
  }

  @Test
View Full Code Here

  @Test
  public void testConnector() throws IOException, InterruptedException,
      FlumeSpecException {
    Context ctx = LogicalNodeContext.testingContext();
    EventSink snk = FlumeBuilder.buildSink(new Context(), "console");
    snk.open();

    EventSource src = FlumeBuilder.buildSource(ctx, SOURCE);
    src.open();

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

    LOG.info("== multi test start");
    String multi = "[ console , accumulator(\"count\") ]";
    EventSource src = FlumeBuilder.buildSource(ctx, SOURCE);
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), multi);
    src.open();
    snk.open();
    EventUtil.dumpAll(src, snk);
    src.close();
    snk.close();
    AccumulatorSink cnt = (AccumulatorSink) ReportManager.get().getReportable(
        "count");
View Full Code Here

    EventSource src = FlumeBuilder.buildSource(ctx, SOURCE);
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(),
        decorated);
    src.open();
    snk.open();
    EventUtil.dumpAll(src, snk);
    src.close();
    snk.close();
    AccumulatorSink cnt = (AccumulatorSink) ReportManager.get().getReportable(
        "count");
View Full Code Here

    // the primary is 90% flakey
    String multi = "< { flakeyAppend(.9,1337) => console } ? accumulator(\"count\") >";
    EventSource src = FlumeBuilder.buildSource(ctx, SOURCE);
    EventSink snk = FlumeBuilder.buildSink(new ReportTestingContext(), multi);
    src.open();
    snk.open();
    EventUtil.dumpAll(src, snk);
    src.close();
    snk.close();
    AccumulatorSink cnt = (AccumulatorSink) ReportManager.get().getReportable(
        "count");
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.