Examples of PutChunkReplicaRequest


Examples of io.crate.blob.PutChunkReplicaRequest

    public void testPutChunkReplicaRequestSerialization() throws Exception {
        BytesStreamOutput outputStream = new BytesStreamOutput();

        UUID transferId = UUID.randomUUID();

        PutChunkReplicaRequest requestOut = new PutChunkReplicaRequest();
        requestOut.index("foo");
        requestOut.transferId = transferId;
        requestOut.currentPos = 10;
        requestOut.isLast = false;
        requestOut.content = new BytesArray(new byte[] { 0x65, 0x66 });
        requestOut.sourceNodeId = "nodeId";

        requestOut.writeTo(outputStream);
        BytesStreamInput inputStream = new BytesStreamInput(outputStream.bytes().copyBytesArray());

        PutChunkReplicaRequest requestIn = new PutChunkReplicaRequest();
        requestIn.readFrom(inputStream);

        assertEquals(requestOut.currentPos, requestIn.currentPos);
        assertEquals(requestOut.isLast, requestIn.isLast);
        assertEquals(requestOut.content, requestIn.content);
        assertEquals(requestOut.transferId, requestIn.transferId);
        assertEquals(requestOut.index(), requestIn.index());
    }
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.