Examples of markEndOfRecord()


Examples of org.apache.hama.bsp.message.io.SpilledByteBuffer.markEndOfRecord()

  public void testSpillingByteBuffer() throws Exception {
    ByteBuffer buffer = ByteBuffer.allocateDirect(512);
    SpilledByteBuffer spillBuffer = new SpilledByteBuffer(buffer);
    for (int i = 0; i < 100; ++i) {
      spillBuffer.putInt(i);
      spillBuffer.markEndOfRecord();
    }
    spillBuffer.putInt(100);
    assertEquals(spillBuffer.getMarkofLastRecord(), 400);
    assertEquals(spillBuffer.remaining(), (512 - 404));
    spillBuffer.flip();
View Full Code Here

Examples of org.apache.hama.bsp.message.io.SpilledByteBuffer.markEndOfRecord()

  public void testSpillingByteBuffer() throws Exception {
    ByteBuffer buffer = ByteBuffer.allocateDirect(512);
    SpilledByteBuffer spillBuffer = new SpilledByteBuffer(buffer);
    for (int i = 0; i < 100; ++i) {
      spillBuffer.putInt(i);
      spillBuffer.markEndOfRecord();
    }
    spillBuffer.putInt(100);
    assertEquals(spillBuffer.getMarkofLastRecord(), 400);
    assertEquals(spillBuffer.remaining(), (512 - 404));
    spillBuffer.flip();
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.