Example usage for io.netty.handler.codec.memcache.binary BinaryMemcacheRequest setReserved

List of usage examples for io.netty.handler.codec.memcache.binary BinaryMemcacheRequest setReserved

Introduction

In this page you can find the example usage for io.netty.handler.codec.memcache.binary BinaryMemcacheRequest setReserved.

Prototype

BinaryMemcacheRequest setReserved(short reserved);

Source Link

Document

Sets the reserved field value.

Usage

From source file:com.couchbase.client.core.endpoint.binary.BinaryCodec.java

License:Open Source License

/**
 * Creates the actual protocol level request for an incoming get request.
 *
 * @param request the incoming get request.
 * @return the built protocol request.//from w  w  w .j  a va  2  s  . c om
 */
private BinaryMemcacheRequest handleGetRequest(final GetRequest request) {
    int length = request.key().length();
    BinaryMemcacheRequest msg = new DefaultBinaryMemcacheRequest(request.key());
    msg.setOpcode(BinaryMemcacheOpcodes.GET);
    msg.setKeyLength((short) length);
    msg.setTotalBodyLength((short) length);
    msg.setReserved(request.partition());
    return msg;
}

From source file:com.couchbase.client.core.endpoint.binary.BinaryCodec.java

License:Open Source License

private BinaryMemcacheRequest handleRemoveRequest(final RemoveRequest request) {
    BinaryMemcacheRequest msg = new DefaultBinaryMemcacheRequest(request.key());

    msg.setOpcode(BinaryMemcacheOpcodes.DELETE);
    msg.setCAS(request.cas());//from  w w  w. j av  a  2  s  .  co  m
    msg.setKeyLength((short) request.key().length());
    msg.setTotalBodyLength((short) request.key().length());
    msg.setReserved(request.partition());
    return msg;
}