Class HealthCheckedChannelPool
- java.lang.Object
-
- software.amazon.awssdk.http.nio.netty.internal.HealthCheckedChannelPool
-
- All Implemented Interfaces:
io.netty.channel.pool.ChannelPool,Closeable,AutoCloseable,SdkChannelPool
public class HealthCheckedChannelPool extends Object implements SdkChannelPool
An implementation ofChannelPoolthat validates the health of its connections. This wraps anotherChannelPool, and verifies:- All connections acquired from the underlying channel pool are in the active state.
- All connections released into the underlying pool that are not active, are closed before they are released.
NettyConfiguration.connectionAcquireTimeoutMillis()timeout is reached.
-
-
Constructor Summary
Constructors Constructor Description HealthCheckedChannelPool(io.netty.channel.EventLoopGroup eventLoopGroup, NettyConfiguration configuration, SdkChannelPool delegate)
-
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.Future<io.netty.channel.Channel>acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> resultFuture)voidclose()CompletableFuture<Void>collectChannelPoolMetrics(MetricCollector metrics)Collect channel pool metrics into the providedMetricCollectorcollection, completing the returned future when all metric publishing is complete.io.netty.util.concurrent.Future<Void>release(io.netty.channel.Channel channel)io.netty.util.concurrent.Future<Void>release(io.netty.channel.Channel channel, io.netty.util.concurrent.Promise<Void> promise)
-
-
-
Constructor Detail
-
HealthCheckedChannelPool
public HealthCheckedChannelPool(io.netty.channel.EventLoopGroup eventLoopGroup, NettyConfiguration configuration, SdkChannelPool delegate)
-
-
Method Detail
-
acquire
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire()
- Specified by:
acquirein interfaceio.netty.channel.pool.ChannelPool
-
acquire
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> resultFuture)
- Specified by:
acquirein interfaceio.netty.channel.pool.ChannelPool
-
release
public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel)
- Specified by:
releasein interfaceio.netty.channel.pool.ChannelPool
-
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
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceio.netty.channel.pool.ChannelPool- Specified by:
closein interfaceCloseable
-
collectChannelPoolMetrics
public CompletableFuture<Void> collectChannelPoolMetrics(MetricCollector metrics)
Description copied from interface:SdkChannelPoolCollect channel pool metrics into the providedMetricCollectorcollection, completing the returned future when all metric publishing is complete.- Specified by:
collectChannelPoolMetricsin interfaceSdkChannelPool- Parameters:
metrics- The collection to which all metrics should be added.- Returns:
- A future that is completed when all metric publishing is complete.
-
-