use of com.twitter.distributedlog.benchmark.thrift.Message in project distributedlog by twitter.
the class Utils method generateMessage.
public static byte[] generateMessage(long requestMillis, int payLoadSize) throws TException {
byte[] payload = new byte[payLoadSize];
random.nextBytes(payload);
Message msg = new Message(requestMillis, ByteBuffer.wrap(payload));
return MSG_SERIALIZER.get().serialize(msg);
}
use of com.twitter.distributedlog.benchmark.thrift.Message in project distributedlog by twitter.
the class Utils method parseMessage.
public static Message parseMessage(byte[] data) throws TException {
Message msg = new Message();
TMemoryInputTransport transport = new TMemoryInputTransport(data);
TBinaryProtocol protocol = new TBinaryProtocol(transport);
msg.read(protocol);
return msg;
}
Aggregations