Package com.cloudera.flume.core

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


    File tmp = File.createTempFile("syslogText", ".txt");
    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(), "text(\""
        + escapeJava(tmp.getAbsolutePath()) + "\",\"syslog\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here


    File tmp = File.createTempFile("defaultText", ".txt");
    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(), "text(\""
        + escapeJava(tmp.getAbsolutePath()) + "\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    File tmp = File.createTempFile("log4jText", ".txt");
    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(), "text(\""
        + escapeJava(tmp.getAbsolutePath()) + "\",\"log4j\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    File tmp = File.createTempFile("jsonText", ".txt");
    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(), "text(\""
        + escapeJava(tmp.getAbsolutePath()) + "\",\"json\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "customdfs(\"file:///" + escapeJava(tmp.getAbsolutePath())
            + "\",\"syslog\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    File tmp = File.createTempFile("defaultDfs", ".txt");
    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "customdfs(\"file:///" + escapeJava(tmp.getAbsolutePath()) + "\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "customdfs(\"file:///" + escapeJava(tmp.getAbsolutePath())
            + "\",\"log4j\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

    tmp.deleteOnExit();

    EventSink snk = FlumeBuilder.buildSink(new Context(),
        "customdfs(\"file:///" + escapeJava(tmp.getAbsolutePath())
            + "\",\"json\")");
    snk.open();
    for (int i = 0; i < count; i++) {
      Event e = new EventImpl(("simple test " + i).getBytes());
      snk.append(e);
    }
    snk.close();
View Full Code Here

              + e.getMessage());
    }

    Assert.assertNotNull(sink);

    sink.open();

    for (int i = 0; i < count; i++) {
      Event e;

      e = new EventImpl(("test line " + i + "\n").getBytes());
View Full Code Here

    admin.createTable(desc);

    // explicit constructor rather than builder - we want to control the conf
    EventSink snk = new Attr2HBaseEventSink(tableName, tableSysFamily,
        writeBody, tableBody, tableBodyFamily, "2hb_", 0, true, hbaseEnv.conf);
    snk.open();
    try {
      Event e1 = new EventImpl("message0".getBytes(), Clock.unixTime(),
          Priority.INFO, 0, "localhost");
      e1.set("2hb_", Bytes.toBytes("row-key0"));
      e1.set("2hb_family1:column1", Bytes.toBytes("value0"));
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.