Examples of AvroFlumeEvent


Examples of org.apache.flume.source.avro.AvroFlumeEvent

            nettyServer.close();
        }

        public Event poll() {

            AvroFlumeEvent avroEvent = null;
            try {
                avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
            } catch (InterruptedException ie) {
                // Ignore the exception.
            }
            if (avroEvent != null) {
                return EventBuilder.withBody(avroEvent.getBody().array(),
                    toStringMap(avroEvent.getHeaders()));
            } else {
                System.out.println("No Event returned");
            }
            return null;
        }
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

            nettyServer.close();
        }

        public Event poll() {

            AvroFlumeEvent avroEvent = null;
            try {
                avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
            } catch (InterruptedException ie) {
                // Ignore the exception.
            }
            if (avroEvent != null) {
                return EventBuilder.withBody(avroEvent.getBody().array(),
                    toStringMap(avroEvent.getHeaders()));
            } else {
                System.out.println("No Event returned");
            }
            return null;
        }
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

            nettyServer.close();
        }

        public Event poll() {

            AvroFlumeEvent avroEvent = null;
            try {
                avroEvent = eventQueue.poll(30000, TimeUnit.MILLISECONDS);
            } catch (InterruptedException ie) {
                // Ignore the exception.
            }
            if (avroEvent != null) {
                return EventBuilder.withBody(avroEvent.getBody().array(),
                    toStringMap(avroEvent.getHeaders()));
            } else {
                System.out.println("No Event returned");
            }
            return null;
        }
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

      client = SpecificRequestor.getClient(
          AvroSourceProtocol.class, new NettyTransceiver(new InetSocketAddress(
              selectedPort)));
    }

    AvroFlumeEvent avroEvent = new AvroFlumeEvent();

    avroEvent.setHeaders(new HashMap<CharSequence, CharSequence>());
    avroEvent.setBody(ByteBuffer.wrap("Hello avro".getBytes()));

    Status status = client.append(avroEvent);

    Assert.assertEquals(Status.OK, status);
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

    AvroSourceProtocol client = SpecificRequestor.getClient(
        AvroSourceProtocol.class, new NettyTransceiver(new InetSocketAddress(
        selectedPort), new SSLChannelFactory()));

    AvroFlumeEvent avroEvent = new AvroFlumeEvent();

    avroEvent.setHeaders(new HashMap<CharSequence, CharSequence>());
    avroEvent.setBody(ByteBuffer.wrap("Hello avro ssl".getBytes()));

    Status status = client.append(avroEvent);

    Assert.assertEquals(Status.OK, status);
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

          }

          eventBuffer.clear();
        }

        AvroFlumeEvent avroEvent = new AvroFlumeEvent();

        avroEvent.headers = new HashMap<CharSequence, CharSequence>();
        avroEvent.body = ByteBuffer.wrap(line.getBytes());

        eventBuffer.add(avroEvent);
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

        if (event == null) {
          counterGroup.incrementAndGet("batch.underflow");
          break;
        }

        AvroFlumeEvent avroEvent = new AvroFlumeEvent();

        avroEvent.body = ByteBuffer.wrap(event.getBody());
        avroEvent.headers = new HashMap<CharSequence, CharSequence>();

        for (Entry<String, String> entry : event.getHeaders().entrySet()) {
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

    AvroSourceProtocol client = SpecificRequestor.getClient(
        AvroSourceProtocol.class, new NettyTransceiver(new InetSocketAddress(
            selectedPort)));

    AvroFlumeEvent avroEvent = new AvroFlumeEvent();

    avroEvent.headers = new HashMap<CharSequence, CharSequence>();
    avroEvent.body = ByteBuffer.wrap("Hello avro".getBytes());

    Status status = client.append(avroEvent);
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

            delay = DEFAULT_RECONNECTION_DELAY;
        }
        if (retries == 0) {
            retries = DEFAULT_RECONNECTS;
        }
        AvroFlumeEvent avroEvent = new AvroFlumeEvent();
        avroEvent.body = ByteBuffer.wrap(event.getBody());
        avroEvent.headers = new HashMap<CharSequence, CharSequence>();

        for (Map.Entry<String, String> entry : event.getHeaders().entrySet()) {
          avroEvent.headers.put(entry.getKey(), entry.getValue());
View Full Code Here

Examples of org.apache.flume.source.avro.AvroFlumeEvent

    assertReady();

    CallFuture<Status> callFuture = new CallFuture<Status>();

    try {
      AvroFlumeEvent avroEvent = new AvroFlumeEvent();
      avroEvent.setBody(ByteBuffer.wrap(event.getBody()));
      avroEvent.setHeaders(toCharSeqMap(event.getHeaders()));
      avroClient.append(avroEvent, callFuture);
    } catch (IOException ex) {
      logger.error("RPC request IO exception. " , ex);
      throw new EventDeliveryException("RPC request IO exception. " +
          "Exception follows.", ex);
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.