public void flushPartitions(ChannelPoolPartitionSelector selector) { channelPool.flushPartitions(selector); } }
public void flushPartition(Object partitionKey) { channelPool.flushPartition(partitionKey); }
public boolean removeAll(Channel connection) { return channelPool.removeAll(connection); }
@Override public void flushPartitions(ChannelPoolPartitionSelector selector) { for (Map.Entry<Object, ConcurrentLinkedQueue<IdleChannel>> partitionsEntry : partitions.entrySet()) { Object partitionKey = partitionsEntry.getKey(); if (selector.select(partitionKey)) flushPartition(partitionKey, partitionsEntry.getValue()); } } }
public DefaultChannelPool(long maxIdleTime,// int maxConnectionTTL,// boolean sslConnectionPoolEnabled,// Timer nettyTimer) { this.sslConnectionPoolEnabled = sslConnectionPoolEnabled; this.maxIdleTime = maxIdleTime; this.maxConnectionTTL = maxConnectionTTL; maxConnectionTTLDisabled = maxConnectionTTL <= 0; this.nettyTimer = nettyTimer; maxIdleTimeDisabled = maxIdleTime <= 0; cleanerPeriod = Math.min(maxConnectionTTLDisabled ? Long.MAX_VALUE : maxConnectionTTL, maxIdleTimeDisabled ? Long.MAX_VALUE : maxIdleTime); if (!maxConnectionTTLDisabled || !maxIdleTimeDisabled) scheduleNewIdleChannelDetector(new IdleChannelDetector()); }
private boolean isTTLExpired(Channel channel, long now) { if (maxConnectionTTLDisabled) return false; ChannelCreation creation = channelId2Creation.get(channelId(channel)); return creation != null && now - creation.creationTime >= maxConnectionTTL; }
@Override public void flushPartitions(ChannelPoolPartitionSelector selector) { for (Map.Entry<Object, ConcurrentLinkedQueue<IdleChannel>> partitionsEntry : partitions.entrySet()) { Object partitionKey = partitionsEntry.getKey(); if (selector.select(partitionKey)) flushPartition(partitionKey, partitionsEntry.getValue()); } } }
public DefaultChannelPool(long maxIdleTime,// int maxConnectionTTL,// boolean sslConnectionPoolEnabled,// Timer nettyTimer) { this.sslConnectionPoolEnabled = sslConnectionPoolEnabled; this.maxIdleTime = maxIdleTime; this.maxConnectionTTL = maxConnectionTTL; maxConnectionTTLDisabled = maxConnectionTTL <= 0; this.nettyTimer = nettyTimer; maxIdleTimeDisabled = maxIdleTime <= 0; cleanerPeriod = Math.min(maxConnectionTTLDisabled ? Long.MAX_VALUE : maxConnectionTTL, maxIdleTimeDisabled ? Long.MAX_VALUE : maxIdleTime); if (!maxConnectionTTLDisabled || !maxIdleTimeDisabled) scheduleNewIdleChannelDetector(new IdleChannelDetector()); }
public void flushPartitions(ChannelPoolPartitionSelector selector) { channelPool.flushPartitions(selector); } }
public void flushPartition(Object partitionKey) { channelPool.flushPartition(partitionKey); }
public boolean removeAll(Channel connection) { return channelPool.removeAll(connection); }
@Override public void flushPartitions(ChannelPoolPartitionSelector selector) { for (Map.Entry<Object, ConcurrentLinkedQueue<IdleChannel>> partitionsEntry : partitions.entrySet()) { Object partitionKey = partitionsEntry.getKey(); if (selector.select(partitionKey)) flushPartition(partitionKey, partitionsEntry.getValue()); } } }
public DefaultChannelPool(// long maxIdleTime,// int maxConnectionTTL,// boolean sslConnectionPoolEnabled,// Timer nettyTimer) { this.sslConnectionPoolEnabled = sslConnectionPoolEnabled; this.maxIdleTime = maxIdleTime; this.maxConnectionTTL = maxConnectionTTL; maxConnectionTTLDisabled = maxConnectionTTL <= 0; this.nettyTimer = nettyTimer; maxIdleTimeDisabled = maxIdleTime <= 0; cleanerPeriod = Math.min(maxConnectionTTLDisabled ? Long.MAX_VALUE : maxConnectionTTL, maxIdleTimeDisabled ? Long.MAX_VALUE : maxIdleTime); if (!maxConnectionTTLDisabled || !maxIdleTimeDisabled) scheduleNewIdleChannelDetector(new IdleChannelDetector()); }
public void flushPartitions(ChannelPoolPartitionSelector selector) { channelPool.flushPartitions(selector); } }
public void flushPartition(String partitionId) { channelPool.flushPartition(partitionId); }
public boolean removeAll(Channel connection) { return channelPool.removeAll(connection); }
@Override public void flushPartitions(ChannelPoolPartitionSelector selector) { for (Map.Entry<Object, ConcurrentLinkedQueue<IdleChannel>> partitionsEntry : partitions.entrySet()) { Object partitionKey = partitionsEntry.getKey(); if (selector.select(partitionKey)) flushPartition(partitionKey, partitionsEntry.getValue()); } } }
public void flushPartitions(ChannelPoolPartitionSelector selector) { channelPool.flushPartitions(selector); } }
public void flushPartition(String partitionId) { channelPool.flushPartition(partitionId); }
public boolean removeAll(Channel connection) { return channelPool.removeAll(connection); }