Examples of toChannelBuffer()


Examples of org.elasticsearch.common.bytes.BytesReference.toChannelBuffer()

        BytesReference content = response.content();
        ChannelBuffer buffer;
        boolean addedReleaseListener = false;
        try {
            if (response.contentThreadSafe()) {
                buffer = content.toChannelBuffer();
            } else {
                buffer = content.copyBytesArray().toChannelBuffer();
            }
            // handle JSONP
            String callback = request.param("callback");
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesReference.toChannelBuffer()

        BytesReference content = response.content();
        ChannelBuffer buffer;
        boolean addedReleaseListener = false;
        try {
            if (response.contentThreadSafe()) {
                buffer = content.toChannelBuffer();
            } else {
                buffer = content.copyBytesArray().toChannelBuffer();
            }
            // handle JSONP
            String callback = request.param("callback");
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesReference.toChannelBuffer()

        byte status = 0;
        status = TransportStatus.setResponse(status);
        status = TransportStatus.setError(status);

        BytesReference bytes = stream.bytes();
        ChannelBuffer buffer = bytes.toChannelBuffer();
        NettyHeader.writeHeader(buffer, requestId, status, version);
        channel.write(buffer);
    }
}
View Full Code Here

Examples of org.elasticsearch.common.bytes.ReleasableBytesReference.toChannelBuffer()

            stream.setVersion(version);
            response.writeTo(stream);
            stream.close();

            ReleasableBytesReference bytes = bStream.bytes();
            ChannelBuffer buffer = bytes.toChannelBuffer();
            NettyHeader.writeHeader(buffer, requestId, status, version);
            ChannelFuture future = channel.write(buffer);
            ReleaseChannelFutureListener listener = new ReleaseChannelFutureListener(bytes);
            future.addListener(listener);
            addedReleaseListener = true;
View Full Code Here

Examples of org.elasticsearch.common.bytes.ReleasableBytesReference.toChannelBuffer()

                BytesTransportRequest bRequest = (BytesTransportRequest) request;
                assert node.version().equals(bRequest.version());
                bRequest.writeThin(stream);
                stream.close();
                bytes = bStream.bytes();
                ChannelBuffer headerBuffer = bytes.toChannelBuffer();
                ChannelBuffer contentBuffer = bRequest.bytes().toChannelBuffer();
                buffer = ChannelBuffers.wrappedBuffer(NettyUtils.DEFAULT_GATHERING, headerBuffer, contentBuffer);
            } else {
                request.writeTo(stream);
                stream.close();
View Full Code Here

Examples of org.elasticsearch.common.bytes.ReleasableBytesReference.toChannelBuffer()

                buffer = ChannelBuffers.wrappedBuffer(NettyUtils.DEFAULT_GATHERING, headerBuffer, contentBuffer);
            } else {
                request.writeTo(stream);
                stream.close();
                bytes = bStream.bytes();
                buffer = bytes.toChannelBuffer();
            }
            NettyHeader.writeHeader(buffer, requestId, status, version);
            ChannelFuture future = targetChannel.write(buffer);
            ReleaseChannelFutureListener listener = new ReleaseChannelFutureListener(bytes);
            future.addListener(listener);
View Full Code Here

Examples of org.xbib.elasticsearch.common.bytes.ReleasableBytesReference.toChannelBuffer()

            stream.setVersion(version);
            response.writeTo(stream);
            stream.close();

            ReleasableBytesReference bytes = bStream.ourBytes();
            ChannelBuffer buffer = bytes.toChannelBuffer();
            NettyHeader.writeHeader(buffer, requestId, status, version);
            ChannelFuture future = channel.write(buffer);
            ReleaseChannelFutureListener listener = new ReleaseChannelFutureListener(bytes);
            future.addListener(listener);
            addedReleaseListener = true;
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.