Package org.elasticsearch.common.io.stream

Examples of org.elasticsearch.common.io.stream.HandlesStreamOutput.writeUTF()


    @Test public void testSharedUTFHandles() throws Exception {
        BytesStreamOutput bytesOut = new BytesStreamOutput();
        HandlesStreamOutput out = new HandlesStreamOutput(bytesOut, 5);
        String lowerThresholdValue = "test";
        String higherThresholdValue = "something that is higher than 5";
        out.writeUTF(lowerThresholdValue);
        out.writeUTF(higherThresholdValue);
        out.writeInt(1);
        out.writeUTF("else");
        out.writeUTF(higherThresholdValue);
        out.writeUTF(lowerThresholdValue);
View Full Code Here


        BytesStreamOutput bytesOut = new BytesStreamOutput();
        HandlesStreamOutput out = new HandlesStreamOutput(bytesOut, 5);
        String lowerThresholdValue = "test";
        String higherThresholdValue = "something that is higher than 5";
        out.writeUTF(lowerThresholdValue);
        out.writeUTF(higherThresholdValue);
        out.writeInt(1);
        out.writeUTF("else");
        out.writeUTF(higherThresholdValue);
        out.writeUTF(lowerThresholdValue);
View Full Code Here

        String lowerThresholdValue = "test";
        String higherThresholdValue = "something that is higher than 5";
        out.writeUTF(lowerThresholdValue);
        out.writeUTF(higherThresholdValue);
        out.writeInt(1);
        out.writeUTF("else");
        out.writeUTF(higherThresholdValue);
        out.writeUTF(lowerThresholdValue);

        HandlesStreamInput in = new HandlesStreamInput(new BytesStreamInput(bytesOut.copiedByteArray()));
        assertThat(in.readUTF(), equalTo(lowerThresholdValue));
View Full Code Here

        String higherThresholdValue = "something that is higher than 5";
        out.writeUTF(lowerThresholdValue);
        out.writeUTF(higherThresholdValue);
        out.writeInt(1);
        out.writeUTF("else");
        out.writeUTF(higherThresholdValue);
        out.writeUTF(lowerThresholdValue);

        HandlesStreamInput in = new HandlesStreamInput(new BytesStreamInput(bytesOut.copiedByteArray()));
        assertThat(in.readUTF(), equalTo(lowerThresholdValue));
        assertThat(in.readUTF(), equalTo(higherThresholdValue));
View Full Code Here

        out.writeUTF(lowerThresholdValue);
        out.writeUTF(higherThresholdValue);
        out.writeInt(1);
        out.writeUTF("else");
        out.writeUTF(higherThresholdValue);
        out.writeUTF(lowerThresholdValue);

        HandlesStreamInput in = new HandlesStreamInput(new BytesStreamInput(bytesOut.copiedByteArray()));
        assertThat(in.readUTF(), equalTo(lowerThresholdValue));
        assertThat(in.readUTF(), equalTo(higherThresholdValue));
        assertThat(in.readInt(), equalTo(1));
View Full Code Here

        if (options.compress()) {
            status = TransportStreams.statusSetCompress(status);
            HandlesStreamOutput stream = cachedEntry.cachedHandlesLzfBytes();
            cachedEntry.bytes().write(HEADER_PLACEHOLDER);
            stream.writeUTF(action);
            message.writeTo(stream);
            stream.flush();
        } else {
            HandlesStreamOutput stream = cachedEntry.cachedHandlesBytes();
            cachedEntry.bytes().write(HEADER_PLACEHOLDER);
View Full Code Here

            message.writeTo(stream);
            stream.flush();
        } else {
            HandlesStreamOutput stream = cachedEntry.cachedHandlesBytes();
            cachedEntry.bytes().write(HEADER_PLACEHOLDER);
            stream.writeUTF(action);
            message.writeTo(stream);
            stream.flush();
        }
        TransportStreams.writeHeader(cachedEntry.bytes().unsafeByteArray(), cachedEntry.bytes().size(), requestId, status);
    }
View Full Code Here

            stream.writeLong(requestId);
            byte status = 0;
            status = TransportStreams.statusSetRequest(status);
            stream.writeByte(status); // 0 for request, 1 for response.

            stream.writeUTF(action);
            message.writeTo(stream);

            final LocalTransport targetTransport = connectedNodes.get(node);
            if (targetTransport == null) {
                throw new NodeNotConnectedException(node, "Node not connected");
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.