java.lang.Object
org.infinispan.client.hotrod.impl.protocol.Codec20
All Implemented Interfaces:
Codec, HotRodConstants
Direct Known Subclasses:
Codec21

public class Codec20 extends Object implements Codec, HotRodConstants
A Hot Rod encoder/decoder for version 2.0 of the protocol.
Since:
7.0
Author:
Galder ZamarreƱo
  • Constructor Details

    • Codec20

      public Codec20()
  • Method Details

    • writeClientListenerInterests

      public void writeClientListenerInterests(io.netty.buffer.ByteBuf buf, Set<Class<? extends Annotation>> classes)
      Specified by:
      writeClientListenerInterests in interface Codec
    • 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
    • writeBloomFilter

      public void writeBloomFilter(io.netty.buffer.ByteBuf buf, int bloomFilterBits)
      Specified by:
      writeBloomFilter in interface Codec
    • estimateExpirationSize

      public int estimateExpirationSize(long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
      Specified by:
      estimateExpirationSize in interface Codec
    • writeHeader

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

      public int estimateHeaderSize(HeaderParams params)
      Specified by:
      estimateHeaderSize in interface Codec
    • 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
    • readCounterEvent

      public HotRodCounterEvent readCounterEvent(io.netty.buffer.ByteBuf buf)
      Description copied from interface: Codec
      Reads a HotRodCounterEvent with the listener-id.
      Specified by:
      readCounterEvent in interface Codec
    • keyIterator

      public <K> org.infinispan.commons.util.CloseableIterator<K> keyIterator(RemoteCache<K,?> remoteCache, OperationsFactory operationsFactory, org.infinispan.commons.util.IntSet segments, int batchSize)
      Description copied from interface: Codec
      Creates a key iterator with the given batch size if applicable. This iterator does not support removal.
      Specified by:
      keyIterator in interface Codec
      Type Parameters:
      K -
      Parameters:
      remoteCache -
      operationsFactory -
      segments -
      batchSize -
      Returns:
    • isObjectStorageHinted

      public boolean isObjectStorageHinted(PingResponse pingResponse)
      Description copied from interface: Codec
      Read the response code for hints of object storage in the server.
      Specified by:
      isObjectStorageHinted in interface Codec
    • estimateSizeMultimapSupportsDuplicated

      public int estimateSizeMultimapSupportsDuplicated()
      Specified by:
      estimateSizeMultimapSupportsDuplicated in interface Codec
      Returns:
      size that needs to be allocated in buffer for supportsDuplicates information.
    • writeMultimapSupportDuplicates

      public void writeMultimapSupportDuplicates(io.netty.buffer.ByteBuf buf, boolean supportsDuplicates)
      Specified by:
      writeMultimapSupportDuplicates in interface Codec
      Parameters:
      buf - , buffer which supportsDuplicates info will be written to.
      supportsDuplicates - , to see whether multimap cache supports duplicates or not.
    • readCacheEvent

      public AbstractClientEvent readCacheEvent(io.netty.buffer.ByteBuf buf, Function<byte[],DataFormat> listenerDataFormat, short eventTypeId, org.infinispan.commons.configuration.ClassAllowList allowList, SocketAddress serverAddress)
      Specified by:
      readCacheEvent in interface Codec
    • returnPossiblePrevValue

      public Object returnPossiblePrevValue(io.netty.buffer.ByteBuf buf, short status, DataFormat dataFormat, int flags, org.infinispan.commons.configuration.ClassAllowList allowList, org.infinispan.commons.marshall.Marshaller marshaller)
      Specified by:
      returnPossiblePrevValue in interface Codec
    • createRemovedEvent

      protected AbstractClientEvent createRemovedEvent(byte[] listenerId, Object key, boolean isRetried)
    • createModifiedEvent

      protected AbstractClientEvent createModifiedEvent(byte[] listenerId, Object key, long dataVersion, boolean isRetried)
    • createCreatedEvent

      protected AbstractClientEvent createCreatedEvent(byte[] listenerId, Object key, long dataVersion, boolean isRetried)
    • createCustomEvent

      protected AbstractClientEvent createCustomEvent(byte[] listenerId, Object eventData, ClientEvent.Type eventType, boolean isRetried)
    • checkForErrorsInResponseStatus

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

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

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