private Semaphore getFreeConnectionsForHost(Object partitionKey) { return freeChannelsPerHost.computeIfAbsent(partitionKey, semaphoreComputer); }
public String getString(String key) { return propsCache.computeIfAbsent(key, new ConcurrentHashMapV8.Fun<String, String>() { @Override public String apply(String key) { String value = System.getProperty(key); if (value == null) { value = (String) customProperties.getProperty(key); } if (value == null) { value = (String) defaultProperties.getProperty(key); } return value; } }); }
public boolean offer(Channel channel, Object partitionKey) { if (isClosed.get() || (!sslConnectionPoolEnabled && channel.getPipeline().get(SslHandler.class) != null)) return false; long now = millisTime(); if (isTTLExpired(channel, now)) return false; boolean added = partitions.computeIfAbsent(partitionKey, PARTITION_COMPUTER).add(new IdleChannel(channel, now)); if (added) channelId2Creation.putIfAbsent(channel.getId(), new ChannelCreation(now, partitionKey)); return added; }