Examples of ThriftFlumeEvent


Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  @Test
  public void testRequest() throws InterruptedException, IOException {
    bind();

    Map flumeMap = new HashMap<CharSequence, ByteBuffer>();
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeMap);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  public void testHeaders() throws InterruptedException, IOException {
    bind();

    Map flumeHeaders = new HashMap<CharSequence, ByteBuffer>();
    flumeHeaders.put("hello", ByteBuffer.wrap("world".getBytes("UTF-8")));
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeHeaders);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  @Test
  public void testRequest() throws InterruptedException, IOException {
    bind();

    Map flumeMap = new HashMap<CharSequence, ByteBuffer>();
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeMap);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  public void testHeaders() throws InterruptedException, IOException {
    bind();

    Map flumeHeaders = new HashMap<CharSequence, ByteBuffer>();
    flumeHeaders.put("hello", ByteBuffer.wrap("world".getBytes("UTF-8")));
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeHeaders);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

            source, LifecycleState.START_OR_ERROR));
    Assert.assertEquals("Server is started", LifecycleState.START,
        source.getLifecycleState());

    Map flumeMap = new HashMap<CharSequence, ByteBuffer>();
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeMap);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  @Test
  public void testRequest() throws InterruptedException, IOException {
    bind();

    Map flumeMap = new HashMap<CharSequence, ByteBuffer>();
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeMap);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of com.cloudera.flume.handlers.thrift.ThriftFlumeEvent

  public void testHeaders() throws InterruptedException, IOException {
    bind();

    Map flumeHeaders = new HashMap<CharSequence, ByteBuffer>();
    flumeHeaders.put("hello", ByteBuffer.wrap("world".getBytes("UTF-8")));
    ThriftFlumeEvent thriftEvent =  new ThriftFlumeEvent(
        1, Priority.INFO, ByteBuffer.wrap("foo".getBytes()),
        0, "fooHost", flumeHeaders);
    FlumeClient fClient = new FlumeClient("0.0.0.0", selectedPort);
    fClient.append(thriftEvent);
View Full Code Here

Examples of org.apache.flume.thrift.ThriftFlumeEvent

      if (!isActive()) {
        throw new EventDeliveryException("Client was closed due to error. " +
          "Please create a new client");
      }
      client = connectionManager.checkout();
      final ThriftFlumeEvent thriftEvent = new ThriftFlumeEvent(event
        .getHeaders(), ByteBuffer.wrap(event.getBody()));
      doAppend(client, thriftEvent).get(requestTimeout, TimeUnit.MILLISECONDS);
    } catch (Throwable e) {
      if (e instanceof ExecutionException) {
        Throwable cause = e.getCause();
View Full Code Here

Examples of org.apache.flume.thrift.ThriftFlumeEvent

      Iterator<Event> eventsIter = events.iterator();
      while (eventsIter.hasNext()) {
        thriftFlumeEvents.clear();
        for (int i = 0; i < batchSize && eventsIter.hasNext(); i++) {
          Event event = eventsIter.next();
          thriftFlumeEvents.add(new ThriftFlumeEvent(event.getHeaders(),
            ByteBuffer.wrap(event.getBody())));
        }
        if (!thriftFlumeEvents.isEmpty()) {
          doAppendBatch(client, thriftFlumeEvents).get(requestTimeout,
            TimeUnit.MILLISECONDS);
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.