Package com.cloudera.flume.core

Examples of com.cloudera.flume.core.Event


    DataInputStream in = new DataInputStream(new ByteArrayInputStream(entry
        .getBytes()));

    SyslogWireExtractor fmt = new SyslogWireExtractor();
    Event e = fmt.extract(in);
   
    // verify that the newline is added when formatting the entry using fmt
    Assert.assertTrue(Arrays.equals(new String(entry + "\n").getBytes(),
        fmt.toBytes(e)));
View Full Code Here


  }

  @Test
  public void testNewFail() {
    String msg = "this will fail";
    Event e = null;
    try {
      DataInputStream in = new DataInputStream(new ByteArrayInputStream(msg
          .getBytes()));

      e = SyslogWireExtractor.extractEvent(in);
View Full Code Here

      s = prevLine;
    }

    Matcher m = l4jPat.matcher(s);
    if (m.matches()) {
      Event e = readUntilNextEvent(m);
      updateEventProcessingStats(e);
      return e;
    }

    // This is unreachable.
View Full Code Here

  public Event next() throws IOException {
    if (count >= msgs)
      return null;// end marker if gotten to count
    count++;

    Event e = new EventImpl(new byte[0]);
    for (String a : attrNames) {
      byte[] val = new byte[valSz];
      rand.nextBytes(val);
      e.set(a, val);

    }
    updateEventProcessingStats(e);

    return e;
View Full Code Here

    if (count >= total && total != 0)
      return null;// end marker if gotten to count
    count++;
    byte[] data = new byte[size];
    rand.nextBytes(data);
    Event e = new EventImpl(data);
    updateEventProcessingStats(e);
    return e;
  }
View Full Code Here

    // build a sink that outputs to that format.
    File f = FileUtil.mktempdir();
    SinkBuilder builder = EscapedCustomDfsSink.builder();
    EventSink snk = builder.build(new Context(), "file:///" + f.getPath()
        + "/sub-%{service}");
    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
    snk.open();
    snk.append(e);
    snk.close();
View Full Code Here

    // build a sink that outputs to that format.
    File f = FileUtil.mktempdir();
    SinkBuilder builder = EscapedCustomDfsSink.builder();
    EventSink snk = builder.build(new Context(), "file:///" + f.getPath()
        + "/sub-%{service}");
    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
    snk.open();
    snk.append(e);
    snk.close();
View Full Code Here

    // build a sink that outputs to that format.
    File f = FileUtil.mktempdir();
    SinkBuilder builder = EscapedCustomDfsSink.builder();
    EventSink snk = builder.build(new Context(), "file:///" + f.getPath()
        + "/sub-%{service}");
    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
    snk.open();
    snk.append(e);
    snk.close();
View Full Code Here

    // build a sink that outputs to that format.
    File f = FileUtil.mktempdir();
    SinkBuilder builder = EscapedCustomDfsSink.builder();
    EventSink snk = builder.build(new Context(), "file:///" + f.getPath()
        + "/sub-%{service}");
    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
    snk.open();
    snk.append(e);
    snk.close();
View Full Code Here

    // build a sink that outputs to that format.
    File f = FileUtil.mktempdir();
    SinkBuilder builder = EscapedCustomDfsSink.builder();
    EventSink snk = builder.build(new Context(), "file:///" + f.getPath()
        + "/sub-%{service}");
    Event e = new EventImpl("this is a test message".getBytes());
    Attributes.setString(e, "service", "foo");
    snk.open();
    snk.append(e);
    snk.close();
View Full Code Here

TOP

Related Classes of com.cloudera.flume.core.Event

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.