Class Codec10
- java.lang.Object
-
- org.infinispan.client.hotrod.impl.protocol.Codec10
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
trace
-
Constructor Summary
Constructors Constructor Description Codec10()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkForErrorsInResponseStatus(io.netty.buffer.ByteBuf buf, HeaderParams params, short status)
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)
int
estimateExpirationSize(long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
int
estimateHeaderSize(HeaderParams headerParams)
Log
getLog()
Logger for Hot Rod client codecAbstractClientEvent
readCacheEvent(io.netty.buffer.ByteBuf buf, Function<byte[],DataFormat> dataFormatFunction, short eventTypeId, org.infinispan.commons.configuration.ClassWhiteList whitelist, SocketAddress serverAddress)
HotRodCounterEvent
readCounterEvent(io.netty.buffer.ByteBuf buf)
Reads aHotRodCounterEvent
with thelistener-id
.short
readHeader(io.netty.buffer.ByteBuf buf, double receivedOpCode, HeaderParams params, ChannelFactory channelFactory, SocketAddress serverAddress)
Reads a response header from the transport and returns the status of the response.long
readMessageId(io.netty.buffer.ByteBuf buf)
protected void
readNewTopologyAndHash(io.netty.buffer.ByteBuf buf, AtomicInteger topologyId, byte[] cacheName, ChannelFactory channelFactory)
protected void
readNewTopologyIfPresent(io.netty.buffer.ByteBuf buf, HeaderParams params, ChannelFactory channelFactory)
short
readOpCode(io.netty.buffer.ByteBuf buf)
<T> T
readUnmarshallByteArray(io.netty.buffer.ByteBuf buf, short status, org.infinispan.commons.configuration.ClassWhiteList whitelist, org.infinispan.commons.marshall.Marshaller marshaller)
Read and unmarshall byte array.Object
returnPossiblePrevValue(io.netty.buffer.ByteBuf buf, short status, int flags, org.infinispan.commons.configuration.ClassWhiteList whitelist, org.infinispan.commons.marshall.Marshaller marshaller)
void
writeClientListenerInterests(io.netty.buffer.ByteBuf buf, Set<Class<? extends Annotation>> classes)
void
writeClientListenerParams(io.netty.buffer.ByteBuf buf, ClientListener clientListener, byte[][] filterFactoryParams, byte[][] converterFactoryParams)
Writes client listener parametersvoid
writeExpirationParams(io.netty.buffer.ByteBuf buf, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
Write lifespan/maxidle parameters.HeaderParams
writeHeader(io.netty.buffer.ByteBuf buf, HeaderParams params)
Writes a request header with the given parameters to the transport and returns an updated header parameters.protected HeaderParams
writeHeader(io.netty.buffer.ByteBuf buf, HeaderParams params, byte version)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.client.hotrod.impl.protocol.Codec
allowOperationsAndEvents, entryIterator, keyIterator, readMeta, readProjectionSize, writeIteratorStartOperation
-
-
-
-
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 interfaceCodec
-
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 interfaceCodec
-
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 interfaceCodec
-
estimateExpirationSize
public int estimateExpirationSize(long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
- Specified by:
estimateExpirationSize
in interfaceCodec
-
writeHeader
protected HeaderParams writeHeader(io.netty.buffer.ByteBuf buf, HeaderParams params, byte version)
-
estimateHeaderSize
public int estimateHeaderSize(HeaderParams headerParams)
- Specified by:
estimateHeaderSize
in interfaceCodec
-
readMessageId
public long readMessageId(io.netty.buffer.ByteBuf buf)
- Specified by:
readMessageId
in interfaceCodec
-
readOpCode
public short readOpCode(io.netty.buffer.ByteBuf buf)
- Specified by:
readOpCode
in interfaceCodec
-
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 interfaceCodec
-
readCacheEvent
public AbstractClientEvent readCacheEvent(io.netty.buffer.ByteBuf buf, Function<byte[],DataFormat> dataFormatFunction, short eventTypeId, org.infinispan.commons.configuration.ClassWhiteList whitelist, SocketAddress serverAddress)
- Specified by:
readCacheEvent
in interfaceCodec
-
readCounterEvent
public HotRodCounterEvent readCounterEvent(io.netty.buffer.ByteBuf buf)
Description copied from interface:Codec
Reads aHotRodCounterEvent
with thelistener-id
.- Specified by:
readCounterEvent
in interfaceCodec
-
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 interfaceCodec
-
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 interfaceCodec
-
writeClientListenerInterests
public void writeClientListenerInterests(io.netty.buffer.ByteBuf buf, Set<Class<? extends Annotation>> classes)
- Specified by:
writeClientListenerInterests
in interfaceCodec
-
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)
-
-