Class GetWithMetadataOperation<K,V>

All Implemented Interfaces:
Runnable, CompletionStage<org.infinispan.api.common.CacheEntry<K,V>>, Future<org.infinispan.api.common.CacheEntry<K,V>>, RetryAwareCompletionStage<org.infinispan.api.common.CacheEntry<K,V>>, HotRodConstants, ChannelOperation

public class GetWithMetadataOperation<K,V> extends AbstractKeyOperation<K,org.infinispan.api.common.CacheEntry<K,V>> implements RetryAwareCompletionStage<org.infinispan.api.common.CacheEntry<K,V>>
Corresponds to getWithMetadata operation as described by Hot Rod protocol specification.
Since:
14.0
  • Constructor Details

    • GetWithMetadataOperation

      public GetWithMetadataOperation(OperationContext operationContext, K key, byte[] keyBytes, org.infinispan.api.common.CacheOptions options, DataFormat dataFormat, SocketAddress preferredServer)
  • Method Details

    • internalExecute

      public RetryAwareCompletionStage<org.infinispan.api.common.CacheEntry<K,V>> internalExecute()
    • executeOperation

      protected void executeOperation(io.netty.channel.Channel channel)
      Description copied from class: RetryOnFailureOperation
      Perform the operation-specific request/response I/O on the specified channel. If an error occurs during I/O, this class will detect it and retry the operation with a different channel by invoking the executeOperation method again.
      Specified by:
      executeOperation in class RetryOnFailureOperation<org.infinispan.api.common.CacheEntry<K,V>>
      Parameters:
      channel - the channel to use for I/O
    • fetchChannelAndInvoke

      protected void fetchChannelAndInvoke(int retryCount, Set<SocketAddress> failedServers)
      Overrides:
      fetchChannelAndInvoke in class AbstractKeyOperation<K,org.infinispan.api.common.CacheEntry<K,V>>
    • acceptResponse

      public void acceptResponse(io.netty.buffer.ByteBuf buf, short status, HeaderDecoder decoder)
      Specified by:
      acceptResponse in class HotRodOperation<org.infinispan.api.common.CacheEntry<K,V>>
    • wasRetried

      public Boolean wasRetried()
      Description copied from interface: RetryAwareCompletionStage
      Returns whether this operation had to be retried on another server than the first one picked.
      Specified by:
      wasRetried in interface RetryAwareCompletionStage<K>
      Returns:
      true if the operation had to be retried on another server, false if it completed without retry or null if the operation is not yet complete.