Examples of take()


Examples of org.apache.flume.channel.MemoryChannel.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.MemoryChannel.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.MemoryChannel.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.MemoryChannel.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.MemoryChannel.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.MemoryChannel.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.PseudoTxnMemoryChannel.take()

    source.setChannelProcessor(new ChannelProcessor(rcs));

    for (long i = 0; i < 100; i++) {
      source.process();
      Event event = channel.take();

      Assert.assertArrayEquals(String.valueOf(i).getBytes(),
          new String(event.getBody()).getBytes());
    }
  }
View Full Code Here

Examples of org.apache.flume.channel.file.FileChannel.take()

    channel.configure(ctx);
    channel.start();
    Transaction tx = channel.getTransaction();
    tx.begin();
    int i = 0;
    while(channel.take() != null) {
      i++;
    }
    tx.commit();
    tx.close();
    channel.stop();
View Full Code Here

Examples of org.apache.maven.plugin.surefire.util.internal.FunkyTwoThreadBlockingQueue.take()

            {
                int num = 0;
                String taken;
                do
                {
                    taken = twoThreadBlockingQueue.take();
                    if ( taken != TwoThreadBlockingQueue.poison )
                    {
                        Assert.assertEquals( "item" + num++, taken );
                    }
                }
View Full Code Here

Examples of org.apache.spark.api.java.JavaPairRDD.take()

                return v1._1.toString();
            }
        });

        assertThat((int) data.count(), is(2));
        System.out.println(data.take(10));
        System.out.println(messages);
        System.out.println(fooBar.take(2));
        System.out.println(map.take(10));
    }
}
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.