Package org.apache.flume.channel.recoverable.memory.wal

Examples of org.apache.flume.channel.recoverable.memory.wal.SequenceIDBuffer.sort()


    SequenceIDBuffer buffer = new SequenceIDBuffer(size);
    Assert.assertEquals(size, buffer.size());
    for (int i = 0; i < 100; i++) {
      buffer.put(i, i);
    }
    buffer.sort();
    Assert.assertFalse(buffer.exists(-1));
    Assert.assertFalse(buffer.exists(101));
    for (int i = 0; i < 100; i++) {
      Assert.assertTrue(buffer.exists(i));
    }
View Full Code Here


    Random random = new Random();
    for (int i = 0; i < 100; i++) {
      buffer.put(i, Math.abs(random.nextLong()));
    }

    buffer.sort();

    long last = Long.MIN_VALUE;
    for (int i = 0; i < 100; i++) {
      long current = buffer.get(i);
      Assert.assertTrue(last <= current);
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.