Package com.cloudera.flume.conf

Examples of com.cloudera.flume.conf.Context


      throws FlumeSpecException {
    String spec = "let benchsink := { benchreport(\"" + name
        + "\") => null } in { mult(10) => { benchinject => { " + deco
        + " => benchsink } } }";

    return FlumeBuilder.buildSink(new Context(), spec);
  }
View Full Code Here


  public static EventSink createSinkBenchmark(String name, String sink)
      throws FlumeSpecException {
    String spec = "{benchinject => {benchreport(\"" + name + "\") => " + sink
        + " } }";
    return FlumeBuilder.buildSink(new Context(), spec);
  }
View Full Code Here

    System.out.println("---");

    String rpt = "foo";
    String snk = "  { intervalDroppyAppend(5)  => { ackChecker => [console, counter(\""
        + rpt + "\") ] } }  ";
    EventSink es = FlumeBuilder.buildSink(new Context(), snk);
    mem.open(); // resets index.
    es.open();
    EventUtil.dumpAll(mem, es);
    node.getAckChecker().checkAcks();
    assertEquals(1, node.getAckChecker().pending.size());
View Full Code Here

public class TestHierarchicalReports {

  @Test
  public void testSimple() throws FlumeSpecException {
    String s = "console";
    EventSink sink = FlumeBuilder.buildSink(new Context(), s);

    Map<String, ReportEvent> reports = new HashMap<String, ReportEvent>();
    sink.getReports("X.", reports);
    String r = "";
    for (Entry<String, ReportEvent> e : reports.entrySet()) {
View Full Code Here

  }

  @Test
  public void testOneDeco() throws FlumeSpecException {
    String s = "{ stubbornAppend => console}";
    EventSink sink = FlumeBuilder.buildSink(new Context(), s);

    Map<String, ReportEvent> reports = new HashMap<String, ReportEvent>();
    sink.getReports("X.", reports);
    String r = "";
    for (Entry<String, ReportEvent> e : reports.entrySet()) {
View Full Code Here

  }

  @Test
  public void testHierarchy() throws FlumeSpecException {
    String s = "{ intervalSampler(5) => { stubbornAppend => { insistentOpen => console } } }";
    EventSink sink = FlumeBuilder.buildSink(new Context(), s);

    Map<String, ReportEvent> reports = new HashMap<String, ReportEvent>();
    sink.getReports("X.", reports);
    String r = "";
    for (Entry<String, ReportEvent> e : reports.entrySet()) {
View Full Code Here

*/
public class TestCollectorSource {

  @Test
  public void testBuilder() throws FlumeSpecException {
    Context ctx = LogicalNodeContext.testingContext();
    String src = "collectorSource";
    FlumeBuilder.buildSource(ctx, src);

    String src2 = "collectorSource(5150)";
    FlumeBuilder.buildSource(ctx, src2);
View Full Code Here

  @Test
  public void testCollectorSource() throws FlumeSpecException, IOException,
      InterruptedException {
    EventSource src = FlumeBuilder.buildSource(LogicalNodeContext
        .testingContext(), "collectorSource(34568)");
    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "rpcSink(\"localhost\", 34568)");
    src.open();
    snk.open();
    snk.append(new EventImpl("foo".getBytes()));
    src.next();
View Full Code Here

  @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);

    // dir / filename
    String src2 = "collectorSink(\"file:///tmp/test\", \"testfilename\")";
    FlumeBuilder.buildSink(new Context(), src2);

    // millis
    String src3 = "collectorSink(\"file:///tmp/test\", \"testfilename\", 1000)";
    FlumeBuilder.buildSink(new Context(), src3);
  }
View Full Code Here

  @Test(expected = FlumeArgException.class)
  public void testBuilderFail() throws FlumeSpecException {
    // too many arguments
    String src4 = "collectorSink(\"file:///tmp/test\", \"bkjlasdf\", 1000, 1000)";
    FlumeBuilder.buildSink(new Context(), src4);
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.conf.Context

Copyright © 2018 www.massapicom. 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.