Interface Codec

All Known Implementing Classes:
Codec40

public interface Codec
A Hot Rod protocol encoder/decoder.
Since:
14.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
     
    default <K, V> org.infinispan.commons.util.CloseableIterator<org.infinispan.api.common.CacheEntry<K,V>>
    entryIterator(RemoteCache<K,V> remoteCache, org.infinispan.commons.util.IntSet segments, int batchSize)
    Creates an entry iterator with the given batch size if applicable.
    int
    estimateExpirationSize(org.infinispan.api.common.CacheEntryExpiration.Impl expiration)
     
    int
     
    int
     
    static Codec
     
    boolean
    Read the response code for hints of object storage in the server.
    default <K> org.infinispan.commons.util.CloseableIterator<K>
    keyIterator(RemoteCache<K,?> remoteCache, CacheOperationsFactory cacheOperationsFactory, org.infinispan.api.common.CacheOptions options, org.infinispan.commons.util.IntSet segments, int batchSize)
    Creates a key iterator with the given batch size if applicable.
    readCacheEvent(io.netty.buffer.ByteBuf buf, Function<byte[],DataFormat> listenerDataFormat, short eventTypeId, org.infinispan.commons.configuration.ClassAllowList allowList, SocketAddress serverAddress)
     
    readCounterEvent(io.netty.buffer.ByteBuf buf)
    Reads a HotRodCounterEvent with the listener-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.
    default org.infinispan.commons.dataconversion.MediaType
    readKeyType(io.netty.buffer.ByteBuf buf)
    Reads the MediaType of the key during initial ping of the cache.
    long
    readMessageId(io.netty.buffer.ByteBuf buf)
     
    default short
    readMeta(io.netty.buffer.ByteBuf buf)
    Iteration read to tell if metadata is present for entry
    short
    readOpCode(io.netty.buffer.ByteBuf buf)
     
    default int
    readProjectionSize(io.netty.buffer.ByteBuf buf)
    Iteration read for projection size
    default org.infinispan.commons.dataconversion.MediaType
    readValueType(io.netty.buffer.ByteBuf buf)
    Reads the MediaType of the key during initial ping of the cache.
    <K, V> org.infinispan.api.common.CacheEntry<K,V>
    returnPossiblePrevValue(K key, io.netty.buffer.ByteBuf buf, short status, DataFormat dataFormat, int flags, org.infinispan.commons.configuration.ClassAllowList allowList, org.infinispan.commons.marshall.Marshaller marshaller)
     
    void
    writeBloomFilter(io.netty.buffer.ByteBuf buf, int bloomFilterBits)
     
    void
    writeClientListenerInterests(io.netty.buffer.ByteBuf buf, EnumSet<org.infinispan.api.common.events.cache.CacheEntryEventType> types)
     
    void
    writeClientListenerParams(io.netty.buffer.ByteBuf buf, ClientListener clientListener, byte[][] filterFactoryParams, byte[][] converterFactoryParams)
    Writes client listener parameters
    void
    writeExpirationParams(io.netty.buffer.ByteBuf buf, org.infinispan.api.common.CacheEntryExpiration.Impl expiration)
    Write lifespan/maxidle parameters.
    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.
    default void
    writeIteratorStartOperation(io.netty.buffer.ByteBuf buf, org.infinispan.commons.util.IntSet segments, String filterConverterFactory, int batchSize, boolean metadata, byte[][] filterParameters)
     
    void
    writeMultimapSupportDuplicates(io.netty.buffer.ByteBuf buf, boolean supportsDuplicates)
     
  • Method Details

    • forProtocol

      static Codec forProtocol(ProtocolVersion version)
    • estimateHeaderSize

      int estimateHeaderSize(HeaderParams headerParams)
    • writeHeader

      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.
    • writeClientListenerParams

      void writeClientListenerParams(io.netty.buffer.ByteBuf buf, ClientListener clientListener, byte[][] filterFactoryParams, byte[][] converterFactoryParams)
      Writes client listener parameters
    • writeExpirationParams

      void writeExpirationParams(io.netty.buffer.ByteBuf buf, org.infinispan.api.common.CacheEntryExpiration.Impl expiration)
      Write lifespan/maxidle parameters.
    • writeBloomFilter

      void writeBloomFilter(io.netty.buffer.ByteBuf buf, int bloomFilterBits)
    • estimateExpirationSize

      int estimateExpirationSize(org.infinispan.api.common.CacheEntryExpiration.Impl expiration)
    • readMessageId

      long readMessageId(io.netty.buffer.ByteBuf buf)
    • readOpCode

      short readOpCode(io.netty.buffer.ByteBuf buf)
    • readHeader

      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.
    • readCacheEvent

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

      <K, V> org.infinispan.api.common.CacheEntry<K,V> returnPossiblePrevValue(K key, io.netty.buffer.ByteBuf buf, short status, DataFormat dataFormat, int flags, org.infinispan.commons.configuration.ClassAllowList allowList, org.infinispan.commons.marshall.Marshaller marshaller)
    • writeClientListenerInterests

      void writeClientListenerInterests(io.netty.buffer.ByteBuf buf, EnumSet<org.infinispan.api.common.events.cache.CacheEntryEventType> types)
    • readCounterEvent

      HotRodCounterEvent readCounterEvent(io.netty.buffer.ByteBuf buf)
      Reads a HotRodCounterEvent with the listener-id.
    • allowOperationsAndEvents

      default boolean allowOperationsAndEvents()
      Returns:
      True if we can send operations after registering a listener on given channel
    • readProjectionSize

      default int readProjectionSize(io.netty.buffer.ByteBuf buf)
      Iteration read for projection size
      Parameters:
      buf -
      Returns:
    • readMeta

      default short readMeta(io.netty.buffer.ByteBuf buf)
      Iteration read to tell if metadata is present for entry
      Parameters:
      buf -
      Returns:
    • writeIteratorStartOperation

      default void writeIteratorStartOperation(io.netty.buffer.ByteBuf buf, org.infinispan.commons.util.IntSet segments, String filterConverterFactory, int batchSize, boolean metadata, byte[][] filterParameters)
    • keyIterator

      default <K> org.infinispan.commons.util.CloseableIterator<K> keyIterator(RemoteCache<K,?> remoteCache, CacheOperationsFactory cacheOperationsFactory, org.infinispan.api.common.CacheOptions options, org.infinispan.commons.util.IntSet segments, int batchSize)
      Creates a key iterator with the given batch size if applicable. This iterator does not support removal.
      Type Parameters:
      K -
      Parameters:
      remoteCache -
      cacheOperationsFactory -
      segments -
      batchSize -
      Returns:
    • entryIterator

      default <K, V> org.infinispan.commons.util.CloseableIterator<org.infinispan.api.common.CacheEntry<K,V>> entryIterator(RemoteCache<K,V> remoteCache, org.infinispan.commons.util.IntSet segments, int batchSize)
      Creates an entry iterator with the given batch size if applicable. This iterator does not support removal.
      Type Parameters:
      K -
      V -
      Parameters:
      remoteCache -
      segments -
      batchSize -
      Returns:
    • readKeyType

      default org.infinispan.commons.dataconversion.MediaType readKeyType(io.netty.buffer.ByteBuf buf)
      Reads the MediaType of the key during initial ping of the cache.
    • readValueType

      default org.infinispan.commons.dataconversion.MediaType readValueType(io.netty.buffer.ByteBuf buf)
      Reads the MediaType of the key during initial ping of the cache.
    • isObjectStorageHinted

      boolean isObjectStorageHinted(PingResponse pingResponse)
      Read the response code for hints of object storage in the server.
    • estimateSizeMultimapSupportsDuplicated

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

      void writeMultimapSupportDuplicates(io.netty.buffer.ByteBuf buf, boolean supportsDuplicates)
      Parameters:
      buf - , buffer which supportsDuplicates info will be written to.
      supportsDuplicates - , to see whether multimap cache supports duplicates or not.