Examples of ByteMessage


Examples of org.apache.hama.bsp.message.type.ByteMessage

public class TestMessages extends TestCase {

  public void testByteMessage() {
    int dataSize = (int) (Runtime.getRuntime().maxMemory() * 0.60);
    ByteMessage msg = new ByteMessage(Bytes.toBytes("tag"), new byte[dataSize]);
    assertEquals(msg.getData().length, dataSize);
    msg = null;
   
    byte[] dummyData = new byte[1024];
    ByteMessage msg2 = new ByteMessage(Bytes.tail(dummyData, 128), dummyData);
    assertEquals(
        Bytes.compareTo(msg2.getTag(), 0, 128, msg2.getData(),
            msg2.getData().length - 128, 128), 0);
  }
View Full Code Here

Examples of org.apache.hama.bsp.message.type.ByteMessage

public class TestMessages extends TestCase {

  public void testByteMessage() {
    int dataSize = 1234;
    ByteMessage msg = new ByteMessage(Bytes.toBytes("tag"), new byte[dataSize]);
    assertEquals(msg.getData().length, dataSize);
    msg = null;

    byte[] dummyData = new byte[1024];
    ByteMessage msg2 = new ByteMessage(Bytes.tail(dummyData, 128), dummyData);
    assertEquals(Bytes.compareTo(msg2.getTag(), 0, 128, msg2.getData(),
        msg2.getData().length - 128, 128), 0);
  }
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.