Class AddOperation

  • All Implemented Interfaces:
    Runnable, CompletionStage<Long>, Future<Long>, org.infinispan.client.hotrod.impl.protocol.HotRodConstants, org.infinispan.client.hotrod.impl.transport.netty.ChannelOperation

    public class AddOperation
    extends org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation<T>
    Add operation.

    Adds the delta to the counter's value and returns the result.

    It can throw a CounterOutOfBoundsException if the counter is bounded and the it has been reached.

    Since:
    9.2
    Author:
    Pedro Ruivo
    • Constructor Detail

      • AddOperation

        public AddOperation​(org.infinispan.client.hotrod.impl.protocol.Codec codec,
                            org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory channelFactory,
                            AtomicInteger topologyId,
                            Configuration cfg,
                            String counterName,
                            long delta,
                            boolean useConsistentHash)
    • Method Detail

      • executeOperation

        protected void executeOperation​(io.netty.channel.Channel channel)
        Specified by:
        executeOperation in class org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation<Long>
      • acceptResponse

        public void acceptResponse​(io.netty.buffer.ByteBuf buf,
                                   short status,
                                   org.infinispan.client.hotrod.impl.transport.netty.HeaderDecoder decoder)
        Specified by:
        acceptResponse in class org.infinispan.client.hotrod.impl.operations.HotRodOperation<Long>
      • fetchChannelAndInvoke

        protected void fetchChannelAndInvoke​(int retryCount,
                                             Set<SocketAddress> failedServers)
        Overrides:
        fetchChannelAndInvoke in class org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation<T>
      • handleException

        protected Throwable handleException​(Throwable cause,
                                            io.netty.channel.ChannelHandlerContext ctx,
                                            SocketAddress address)
        Overrides:
        handleException in class org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation<T>
      • addParams

        protected void addParams​(StringBuilder sb)
        Overrides:
        addParams in class org.infinispan.client.hotrod.impl.operations.HotRodOperation<T>