Package com.cloudera.flume.handlers.text

Examples of com.cloudera.flume.handlers.text.SyslogEntryFormat


    snk.open();
    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    File fo = new File(f.getPath() + "/sub-foo");
View Full Code Here


    snk.open();
    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    // read the gzip file and verify the contents
View Full Code Here

    snk.open();
    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    // read the gzip file and verify the contents
View Full Code Here

    snk.open();
    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    // read the gzip file and verify the contents
View Full Code Here

    snk.open();
    snk.append(e);
    snk.close();

    ByteArrayOutputStream exWriter = new ByteArrayOutputStream();
    SyslogEntryFormat fmt = new SyslogEntryFormat();
    fmt.format(exWriter, e);
    exWriter.close();
    String expected = new String(exWriter.toByteArray());

    // check the output to make sure it is what we expected.
    // read the gzip file and verify the contents
View Full Code Here

    txt.close();

    b.mark("disk_loaded");
    Event e = null;
    NullSink sink = new NullSink();
    SyslogEntryFormat syslog = new SyslogEntryFormat();
    while ((e = mem.next()) != null) {
      Event e2 = syslog.extract(new String(e.getBody()), 2009);
      sink.append(e2);
    }
    sink.close();
    b.mark("warmup done");

    e = null;
    mem.open();
    while ((e = mem.next()) != null) {
      Event e2 = syslog.extract(new String(e.getBody()), 2009);
      sink.append(e2);
    }
    sink.close();
    b.mark("sample dump done");

    e = null;
    mem.open();
    CounterSink sink2 = new CounterSink("counter");

    while ((e = mem.next()) != null) {
      Event e2 = syslog.extract(new String(e.getBody()), 2009);
      sink2.append(e2);
    }
    sink2.close();
    b.mark("count done", sink2.getCount());
View Full Code Here

    Assert.assertTrue(s.endsWith("INFO log4j: test\n"));
  }

  @Test
  public void testSyslogEntry() throws IOException {
    OutputFormat format = new SyslogEntryFormat();
    ByteArrayOutputStream sos = new ByteArrayOutputStream();
    format.format(sos, e);
    String s = new String(sos.toByteArray());
    System.out.print(s);
    Assert.assertTrue(s.endsWith("hostname test\n"));
  }
View Full Code Here

    checkOutputFormat("avrojson", new AvroJsonOutputFormat());
  }

  @Test
  public void testSyslogOutputFormat() throws IOException, InterruptedException {
    checkOutputFormat("syslog", new SyslogEntryFormat());
  }
View Full Code Here

   * @throws IOException
   * @throws InterruptedException
   */
  @Test
  public void testGZipCodec() throws IOException, InterruptedException {
    checkOutputFormat("syslog", new SyslogEntryFormat(), "GzipCodec",
        new GzipCodec());
  }
View Full Code Here

   * @throws IOException
   * @throws InterruptedException
   */
  @Test
  public void testBZip2Codec() throws IOException, InterruptedException {
    checkOutputFormat("syslog", new SyslogEntryFormat(), "BZip2Codec",
        new BZip2Codec());
  }
View Full Code Here

TOP

Related Classes of com.cloudera.flume.handlers.text.SyslogEntryFormat

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.