Class RntbdClientChannelPool
- java.lang.Object
-
- io.netty.channel.pool.SimpleChannelPool
-
- com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdClientChannelPool
-
- All Implemented Interfaces:
io.netty.channel.pool.ChannelPool,Closeable,AutoCloseable
public final class RntbdClientChannelPool extends io.netty.channel.pool.SimpleChannelPoolChannelPoolimplementation that enforces a maximum number of concurrent direct TCP Cosmos connections
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.util.concurrent.Future<io.netty.channel.Channel>acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> promise)intchannelsAcquired()intchannelsAvailable()voidclose()booleanisClosed()intmaxChannels()intmaxRequestsPerChannel()protected booleanofferChannel(io.netty.channel.Channel channel)Offer aChannelback to the internal storageprotected io.netty.channel.ChannelpollChannel()Poll aChannelout of internal storage to reuse itio.netty.util.concurrent.Future<Void>release(io.netty.channel.Channel channel, io.netty.util.concurrent.Promise<Void> promise)SocketAddressremoteAddress()intrequestQueueLength()StringtoString()longusedDirectMemory()longusedHeapMemory()
-
-
-
Method Detail
-
channelsAcquired
public int channelsAcquired()
-
channelsAvailable
public int channelsAvailable()
-
maxChannels
public int maxChannels()
-
maxRequestsPerChannel
public int maxRequestsPerChannel()
-
remoteAddress
public SocketAddress remoteAddress()
-
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:
acquirein interfaceio.netty.channel.pool.ChannelPool- Overrides:
acquirein classio.netty.channel.pool.SimpleChannelPool
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceio.netty.channel.pool.ChannelPool- Specified by:
closein interfaceCloseable- Overrides:
closein classio.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:
releasein interfaceio.netty.channel.pool.ChannelPool- Overrides:
releasein classio.netty.channel.pool.SimpleChannelPool
-
offerChannel
protected boolean offerChannel(io.netty.channel.Channel channel)
Offer aChannelback to the internal storageMaintainers: Implementations of this method must be thread-safe.
- Overrides:
offerChannelin classio.netty.channel.pool.SimpleChannelPool- Parameters:
channel- theChannelto return to internal storage- Returns:
true, if theChannelcould be added to internal storage; otherwisefalse
-
pollChannel
protected io.netty.channel.Channel pollChannel()
Poll aChannelout of internal storage to reuse itMaintainers: 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:
pollChannelin classio.netty.channel.pool.SimpleChannelPool- Returns:
- a value of
null, if noChannelis ready to be reused - See Also:
acquire(Promise)
-
-