Examples of take()


Examples of org.apache.flume.Channel.take()

            Event event = channel.take();
            if (event != null) {

                process(create(event));
                int count = 1;
                while (count < batchSize && (event = channel.take()) != null) {
                    count++;
                    try {
                        process(create(event));
                    } catch (final TException e) {
                        LOGGER.warn("We were unable to build spans from received data...", e);
View Full Code Here

Examples of org.apache.flume.Channel.take()

    List<Event> channelEvents = new ArrayList<Event>();
    Transaction txn = channel.getTransaction();
    txn.begin();
    for (int i = 0; i < 1000; i++) {
      Event e = channel.take();
      if (e == null) {
        throw new NullPointerException("Event is null");
      }
      channelEvents.add(e);
    }
View Full Code Here

Examples of org.apache.flume.Channel.take()

    transaction.begin();
    try {
      Event event = null;
      int txnEventCount = 0;
      for (txnEventCount = 0; txnEventCount < txnEventMax; txnEventCount++) {
        event = channel.take();
        if (event == null) {
          break;
        }

        // reconstruct the path name by substituting place holders
View Full Code Here

Examples of org.apache.flume.Channel.take()

    txn.begin();
    List<PutRequest> actions = new LinkedList<PutRequest>();
    List<AtomicIncrementRequest> increments =
        new LinkedList<AtomicIncrementRequest>();
    for(int i = 0; i < batchSize; i++){
      Event event = channel.take();
      if(event == null){
        status = Status.BACKOFF;
        counterGroup.incrementAndGet("channel.underflow");
        break;
      } else {
View Full Code Here

Examples of org.apache.flume.Channel.take()

    Transaction txn = channel.getTransaction();
    List<Row> actions = new LinkedList<Row>();
    List<Increment> incs = new LinkedList<Increment>();
    txn.begin();
    for(long i = 0; i < batchSize; i++) {
      Event event = channel.take();
      if(event == null){
        status = Status.BACKOFF;
        counterGroup.incrementAndGet("channel.underflow");
        break;
      } else {
View Full Code Here

Examples of org.apache.flume.Channel.take()

    Event event = null;
    Status result = Status.READY;

    try {
      transaction.begin();
      event = channel.take();

      if (event != null) {
        serializer.write(event);

        /*
 
View Full Code Here

Examples of org.apache.flume.Channel.take()

    try {
      transaction.begin();
      int i = 0;
      for (i = 0; i < batchSize; i++) {
        event = channel.take();
        if(event == null) {
          status = Status.BACKOFF;
          break;
        }
      }
View Full Code Here

Examples of org.apache.flume.Channel.take()

    Event event;

    FileOutputStream outputStream = new FileOutputStream(
        "/tmp/flume-execsource." + Thread.currentThread().getId());

    while ((event = channel.take()) != null) {
      outputStream.write(event.getBody());
      outputStream.write('\n');
    }

    outputStream.close();
View Full Code Here

Examples of org.apache.flume.Channel.take()

    transaction.begin();

    long start = System.currentTimeMillis();

    for(int i = 0; i < 5; i++) {
      Event event = channel.take();
      assertNotNull(event);
      assertNotNull(event.getBody());
      assertEquals("flume", new String(event.getBody(), Charsets.UTF_8));
    }
View Full Code Here

Examples of org.apache.flume.Channel.take()

    BucketFlushStatus syncedUp;

    try {
      transaction.begin();
      for (int txnEventCount = 0; txnEventCount < txnEventMax; txnEventCount++) {
        Event event = channel.take();
        if (event == null)
          break;

        // reconstruct the path name by substituting place holders
        String realPath = BucketPath.escapeString(path, event.getHeaders());
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.