Package org.apache.flume.serialization

Examples of org.apache.flume.serialization.EventDeserializer$Builder


  }

  @Test
  public void testSimple() throws IOException {
    ResettableInputStream in = new ResettableTestStringInputStream(mini);
    EventDeserializer des = new BlobDeserializer(new Context(), in);
    validateMiniParse(des);
  }
View Full Code Here


  @Test
  public void testSimpleViaBuilder() throws IOException {
    ResettableInputStream in = new ResettableTestStringInputStream(mini);
    EventDeserializer.Builder builder = new BlobDeserializer.Builder();
    EventDeserializer des = builder.build(new Context(), in);
    validateMiniParse(des);
  }
View Full Code Here

  }

  @Test
  public void testSimpleViaFactory() throws IOException {
    ResettableInputStream in = new ResettableTestStringInputStream(mini);
    EventDeserializer des;
    des = EventDeserializerFactory.getInstance(BlobDeserializer.Builder.class.getName(), new Context(), in);
    validateMiniParse(des);
  }
View Full Code Here

  }

  @Test
  public void testBatch() throws IOException {
    ResettableInputStream in = new ResettableTestStringInputStream(mini);
    EventDeserializer des = new BlobDeserializer(new Context(), in);
    List<Event> events;

    events = des.readEvents(10); // try to read more than we should have
    assertEquals(1, events.size());
    assertEventBodyEquals(mini, events.get(0));

    des.mark();
    des.close();
  }
View Full Code Here

    String longLine = "abcdefghijklmnopqrstuvwxyz\n";
    Context ctx = new Context();
    ctx.put(BlobDeserializer.MAX_BLOB_LENGTH_KEY, "10");

    ResettableInputStream in = new ResettableTestStringInputStream(longLine);
    EventDeserializer des = new BlobDeserializer(ctx, in);

    assertEventBodyEquals("abcdefghij", des.readEvent());
    assertEventBodyEquals("klmnopqrst", des.readEvent());
    assertEventBodyEquals("uvwxyz\n", des.readEvent());
    assertNull(des.readEvent());
  }
View Full Code Here

TOP

Related Classes of org.apache.flume.serialization.EventDeserializer$Builder

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.