Class Codec10

  • All Implemented Interfaces:
    Codec
    Direct Known Subclasses:
    Codec11

    public class Codec10
    extends Object
    implements Codec
    A Hot Rod encoder/decoder for version 1.0 of the protocol.
    Since:
    5.1
    Author:
    Galder ZamarreƱo
    • Field Detail

      • trace

        protected final boolean trace
    • Constructor Detail

      • Codec10

        public Codec10()
    • Method Detail

      • writeHeader

        public HeaderParams writeHeader​(io.netty.buffer.ByteBuf buf,
                                        HeaderParams params)
        Description copied from interface: Codec
        Writes a request header with the given parameters to the transport and returns an updated header parameters.
        Specified by:
        writeHeader in interface Codec
      • writeClientListenerParams

        public void writeClientListenerParams​(io.netty.buffer.ByteBuf buf,
                                              ClientListener clientListener,
                                              byte[][] filterFactoryParams,
                                              byte[][] converterFactoryParams)
        Description copied from interface: Codec
        Writes client listener parameters
        Specified by:
        writeClientListenerParams in interface Codec
      • writeExpirationParams

        public void writeExpirationParams​(io.netty.buffer.ByteBuf buf,
                                          long lifespan,
                                          TimeUnit lifespanTimeUnit,
                                          long maxIdle,
                                          TimeUnit maxIdleTimeUnit)
        Description copied from interface: Codec
        Write lifespan/maxidle parameters.
        Specified by:
        writeExpirationParams in interface Codec
      • writeHeader

        protected HeaderParams writeHeader​(io.netty.buffer.ByteBuf buf,
                                           HeaderParams params,
                                           byte version)
      • readMessageId

        public long readMessageId​(io.netty.buffer.ByteBuf buf)
        Specified by:
        readMessageId in interface Codec
      • readOpCode

        public short readOpCode​(io.netty.buffer.ByteBuf buf)
        Specified by:
        readOpCode in interface Codec
      • readHeader

        public short readHeader​(io.netty.buffer.ByteBuf buf,
                                double receivedOpCode,
                                HeaderParams params,
                                ChannelFactory channelFactory,
                                SocketAddress serverAddress)
        Description copied from interface: Codec
        Reads a response header from the transport and returns the status of the response.
        Specified by:
        readHeader in interface Codec
      • returnPossiblePrevValue

        public Object returnPossiblePrevValue​(io.netty.buffer.ByteBuf buf,
                                              short status,
                                              int flags,
                                              org.infinispan.commons.configuration.ClassWhiteList whitelist,
                                              org.infinispan.commons.marshall.Marshaller marshaller)
        Specified by:
        returnPossiblePrevValue in interface Codec
      • getLog

        public Log getLog()
        Description copied from interface: Codec
        Logger for Hot Rod client codec
        Specified by:
        getLog in interface Codec
      • readUnmarshallByteArray

        public <T> T readUnmarshallByteArray​(io.netty.buffer.ByteBuf buf,
                                             short status,
                                             org.infinispan.commons.configuration.ClassWhiteList whitelist,
                                             org.infinispan.commons.marshall.Marshaller marshaller)
        Description copied from interface: Codec
        Read and unmarshall byte array.
        Specified by:
        readUnmarshallByteArray in interface Codec
      • checkForErrorsInResponseStatus

        protected void checkForErrorsInResponseStatus​(io.netty.buffer.ByteBuf buf,
                                                      HeaderParams params,
                                                      short status)
      • readNewTopologyIfPresent

        protected void readNewTopologyIfPresent​(io.netty.buffer.ByteBuf buf,
                                                HeaderParams params,
                                                ChannelFactory channelFactory)
      • readNewTopologyAndHash

        protected void readNewTopologyAndHash​(io.netty.buffer.ByteBuf buf,
                                              AtomicInteger topologyId,
                                              byte[] cacheName,
                                              ChannelFactory channelFactory)
      • computeNewHashes

        protected Map<SocketAddress,​Set<Integer>> computeNewHashes​(io.netty.buffer.ByteBuf buf,
                                                                         ChannelFactory channelFactory,
                                                                         Log localLog,
                                                                         int newTopologyId,
                                                                         int numKeyOwners,
                                                                         short hashFunctionVersion,
                                                                         int hashSpace,
                                                                         int clusterSize)