Class BaseKeyValueRequest<R extends Response>

    • Method Detail

      • nextOpaque

        public static int nextOpaque()
      • partition

        public void partition​(short partition)
        Description copied from interface: KeyValueRequest
        Allows to set the partition used for this request.
        Specified by:
        partition in interface KeyValueRequest<R extends Response>
        Parameters:
        partition - the partition to set.
      • encodedKeyWithCollection

        protected com.couchbase.client.core.deps.io.netty.buffer.ByteBuf encodedKeyWithCollection​(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator alloc,
                                                                                                  KeyValueChannelContext ctx)
        This method returns an encoded key with or without the collection prefix, depending on the context provided.

        Note that it uses the key set during construction, if you want to encode a different key use the encodedExternalKeyWithCollection(ByteBufAllocator, KeyValueChannelContext, byte[]) method instead.

        Parameters:
        alloc - the buffer allocator to use.
        ctx - the channel context.
        Returns:
        the encoded ID, maybe with the collection prefix in place.
      • encodedExternalKeyWithCollection

        protected com.couchbase.client.core.deps.io.netty.buffer.ByteBuf encodedExternalKeyWithCollection​(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator alloc,
                                                                                                          KeyValueChannelContext ctx,
                                                                                                          byte[] key)
        Encodes a given key with the collection prefix if needed.
        Parameters:
        alloc - the buffer allocator to use.
        ctx - the channel context.
        key - the key to encode with collection id.
        Returns:
        the encoded ID, maybe with the collection prefix in place.
      • serviceType

        public ServiceType serviceType()
        Description copied from interface: Request
        The service type of this request.

        Can be null if this is a 'virtual service' (e.g. transactions), which don't map 1:1 to a particular cluster service, but need to integrate into various codepaths that are built around ServiceType such as ThresholdLoggingTracer. Virtual requests must not be sent into core at present, as there is limited support for them.

        Specified by:
        serviceType in interface Request<R extends Response>
        Returns:
        the service type for this request.
      • bucket

        public String bucket()
        Description copied from interface: Request
        Returns the name of the bucket this request is scoped to, or null if not scoped to a bucket.
        Specified by:
        bucket in interface Request<R extends Response>
        Returns:
        (nullable)
      • operationId

        public String operationId()
        Description copied from interface: Request
        Returns a potentially non-unique identifier that is useful for tracing output.

        Note: might be null! It depends on the type of operation. It is also different from the unqiue operation ID that increments to provide additional context (i.e in query the context uuid, in kv the opaque value).

        Specified by:
        operationId in interface Request<R extends Response>
        Returns:
        if present, the operation id. Null otherwise.