Package org.elasticsearch.common.netty.buffer

Examples of org.elasticsearch.common.netty.buffer.ChannelBuffer.writeShort()


                } else if (opcode == 0x0A || opcode == 0x10) { // NOOP or STATS
                    // TODO once we support setQ we need to wait for them to flush
                    ChannelBuffer writeBuffer = ChannelBuffers.dynamicBuffer(24);
                    writeBuffer.writeByte(0x81)// magic
                    writeBuffer.writeByte(opcode); // opcode
                    writeBuffer.writeShort(0); // key length
                    writeBuffer.writeByte(0); // extra length = flags + expiry
                    writeBuffer.writeByte(0); // data type unused
                    writeBuffer.writeShort(0x0000); // OK
                    writeBuffer.writeInt(0); // data length
                    writeBuffer.writeInt(opaque); // opaque
View Full Code Here


                    writeBuffer.writeByte(0x81)// magic
                    writeBuffer.writeByte(opcode); // opcode
                    writeBuffer.writeShort(0); // key length
                    writeBuffer.writeByte(0); // extra length = flags + expiry
                    writeBuffer.writeByte(0); // data type unused
                    writeBuffer.writeShort(0x0000); // OK
                    writeBuffer.writeInt(0); // data length
                    writeBuffer.writeInt(opaque); // opaque
                    writeBuffer.writeLong(0); // cas
                    channel.write(writeBuffer);
                    return MemcachedDispatcher.IGNORE_REQUEST;
View Full Code Here

                    }
                } else if (request.method() == RestRequest.Method.DELETE) {
                    writeBuffer.writeByte(0x04); // opcode
                }
                short keyLength = request.method() == RestRequest.Method.GET ? (short) request.getUriBytes().length : 0;
                writeBuffer.writeShort(keyLength);
                int extrasLength = request.method() == RestRequest.Method.GET ? 4 : 0;
                writeBuffer.writeByte(extrasLength); // extra length = flags + expiry
                writeBuffer.writeByte(0); // data type unused

                if (response.status().getStatus() >= 500) {
View Full Code Here

                writeBuffer.writeByte(extrasLength); // extra length = flags + expiry
                writeBuffer.writeByte(0); // data type unused

                if (response.status().getStatus() >= 500) {
                    // TODO should we use this?
                    writeBuffer.writeShort(0x0A); // status code
                } else {
                    writeBuffer.writeShort(0x0000); // OK
                }

                int dataLength = request.method() == RestRequest.Method.GET ? response.contentLength() : 0;
View Full Code Here

                if (response.status().getStatus() >= 500) {
                    // TODO should we use this?
                    writeBuffer.writeShort(0x0A); // status code
                } else {
                    writeBuffer.writeShort(0x0000); // OK
                }

                int dataLength = request.method() == RestRequest.Method.GET ? response.contentLength() : 0;
                writeBuffer.writeInt(dataLength + keyLength + extrasLength); // data length
                writeBuffer.writeInt(request.getOpaque()); // opaque
View Full Code Here

                writeBuffer.writeInt(dataLength + keyLength + extrasLength); // data length
                writeBuffer.writeInt(request.getOpaque()); // opaque
                writeBuffer.writeLong(0); // cas

                if (extrasLength > 0) {
                    writeBuffer.writeShort(0);
                    writeBuffer.writeShort(0);
                }
                if (keyLength > 0) {
                    writeBuffer.writeBytes(request.getUriBytes());
                }
View Full Code Here

                writeBuffer.writeInt(request.getOpaque()); // opaque
                writeBuffer.writeLong(0); // cas

                if (extrasLength > 0) {
                    writeBuffer.writeShort(0);
                    writeBuffer.writeShort(0);
                }
                if (keyLength > 0) {
                    writeBuffer.writeBytes(request.getUriBytes());
                }
                ChannelFutureListener releaseContentListener = null;
View Full Code Here

                } else if (opcode == 0x0A || opcode == 0x10) { // NOOP or STATS
                    // TODO once we support setQ we need to wait for them to flush
                    ChannelBuffer writeBuffer = ChannelBuffers.dynamicBuffer(24);
                    writeBuffer.writeByte(0x81)// magic
                    writeBuffer.writeByte(opcode); // opcode
                    writeBuffer.writeShort(0); // key length
                    writeBuffer.writeByte(0); // extra length = flags + expiry
                    writeBuffer.writeByte(0); // data type unused
                    writeBuffer.writeShort(0x0000); // OK
                    writeBuffer.writeInt(0); // data length
                    writeBuffer.writeInt(opaque); // opaque
View Full Code Here

                    writeBuffer.writeByte(0x81)// magic
                    writeBuffer.writeByte(opcode); // opcode
                    writeBuffer.writeShort(0); // key length
                    writeBuffer.writeByte(0); // extra length = flags + expiry
                    writeBuffer.writeByte(0); // data type unused
                    writeBuffer.writeShort(0x0000); // OK
                    writeBuffer.writeInt(0); // data length
                    writeBuffer.writeInt(opaque); // opaque
                    writeBuffer.writeLong(0); // cas
                    channel.write(writeBuffer);
                    return MemcachedDispatcher.IGNORE_REQUEST;
View Full Code Here

                    }
                } else if (request.method() == RestRequest.Method.DELETE) {
                    writeBuffer.writeByte(0x04); // opcode
                }
                short keyLength = request.method() == RestRequest.Method.GET ? (short) getMemcachedRequest().getUriBytes().length : 0;
                writeBuffer.writeShort(keyLength);
                int extrasLength = request.method() == RestRequest.Method.GET ? 4 : 0;
                writeBuffer.writeByte(extrasLength); // extra length = flags + expiry
                writeBuffer.writeByte(0); // data type unused

                if (response.status().getStatus() >= 500) {
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.