Class RntbdClientChannelPool

  • All Implemented Interfaces:
    io.netty.channel.pool.ChannelPool, Closeable, AutoCloseable

    public final class RntbdClientChannelPool
    extends io.netty.channel.pool.SimpleChannelPool
    ChannelPool implementation that enforces a maximum number of concurrent direct TCP Cosmos connections
    • Method Detail

      • channelsAcquired

        public int channelsAcquired()
      • channelsAvailable

        public int channelsAvailable()
      • maxChannels

        public int maxChannels()
      • maxRequestsPerChannel

        public int maxRequestsPerChannel()
      • requestQueueLength

        public int requestQueueLength()
      • usedDirectMemory

        public long usedDirectMemory()
      • usedHeapMemory

        public long usedHeapMemory()
      • isClosed

        public boolean isClosed()
      • acquire

        public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire​(io.netty.util.concurrent.Promise<io.netty.channel.Channel> promise)
        Specified by:
        acquire in interface io.netty.channel.pool.ChannelPool
        Overrides:
        acquire in class io.netty.channel.pool.SimpleChannelPool
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface io.netty.channel.pool.ChannelPool
        Specified by:
        close in interface Closeable
        Overrides:
        close in class io.netty.channel.pool.SimpleChannelPool
      • release

        public io.netty.util.concurrent.Future<Void> release​(io.netty.channel.Channel channel,
                                                             io.netty.util.concurrent.Promise<Void> promise)
        Specified by:
        release in interface io.netty.channel.pool.ChannelPool
        Overrides:
        release in class io.netty.channel.pool.SimpleChannelPool
      • offerChannel

        protected boolean offerChannel​(io.netty.channel.Channel channel)
        Offer a Channel back to the internal storage

        Maintainers: Implementations of this method must be thread-safe.

        Overrides:
        offerChannel in class io.netty.channel.pool.SimpleChannelPool
        Parameters:
        channel - the Channel to return to internal storage
        Returns:
        true, if the Channel could be added to internal storage; otherwise false
      • pollChannel

        protected io.netty.channel.Channel pollChannel()
        Poll a Channel out of internal storage to reuse it

        Maintainers: Implementations of this method must be thread-safe and this type ensures thread safety by calling this method serially on a single-threaded EventExecutor. As a result this method need not (and should not) be synchronized.

        Overrides:
        pollChannel in class io.netty.channel.pool.SimpleChannelPool
        Returns:
        a value of null, if no Channel is ready to be reused
        See Also:
        acquire(Promise)