Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow subclass access to properties on connection pool #1658

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,36 @@
public class PerServerConnectionPool implements IConnectionPool {
private static final Logger LOG = LoggerFactory.getLogger(PerServerConnectionPool.class);
public static final AttributeKey<IConnectionPool> CHANNEL_ATTR = AttributeKey.newInstance("_connection_pool");
private final ConcurrentHashMap<EventLoop, Deque<PooledConnection>> connectionsPerEventLoop =
protected final ConcurrentHashMap<EventLoop, Deque<PooledConnection>> connectionsPerEventLoop =
new ConcurrentHashMap<>();
protected final PooledConnectionFactory pooledConnectionFactory;

private final DiscoveryResult server;
private final SocketAddress serverAddr;
private final NettyClientConnectionFactory connectionFactory;
private final ConnectionPoolConfig config;
private final IClientConfig niwsClientConfig;

private final Counter createNewConnCounter;
private final Counter createConnSucceededCounter;
private final Counter createConnFailedCounter;

private final Counter requestConnCounter;
private final Counter reuseConnCounter;
private final Counter connTakenFromPoolIsNotOpen;
private final Counter maxConnsPerHostExceededCounter;
private final Counter closeAboveHighWaterMarkCounter;
private final Timer connEstablishTimer;
private final AtomicInteger connsInPool;
private final AtomicInteger connsInUse;
protected final DiscoveryResult server;
protected final SocketAddress serverAddr;
protected final NettyClientConnectionFactory connectionFactory;
protected final ConnectionPoolConfig config;
protected final IClientConfig niwsClientConfig;

protected final Counter createNewConnCounter;
protected final Counter createConnSucceededCounter;
protected final Counter createConnFailedCounter;

protected final Counter requestConnCounter;
protected final Counter reuseConnCounter;
protected final Counter connTakenFromPoolIsNotOpen;
protected final Counter maxConnsPerHostExceededCounter;
protected final Counter closeAboveHighWaterMarkCounter;
protected final Timer connEstablishTimer;
protected final AtomicInteger connsInPool;
protected final AtomicInteger connsInUse;

/**
* This is the count of connections currently in progress of being established.
* They will only be added to connsInUse _after_ establishment has completed.
*/
private final AtomicInteger connCreationsInProgress;
protected final AtomicInteger connCreationsInProgress;

private volatile boolean draining;
protected volatile boolean draining;

public PerServerConnectionPool(
DiscoveryResult server,
Expand Down