public void drainChannelAndOffer(Channel channel, NettyResponseFuture<?> future) { drainChannelAndOffer(channel, future, future.isKeepAlive(), future.getPartitionKey()); }
void finishUpdate(NettyResponseFuture<?> future, Channel channel, boolean close) { future.cancelTimeouts(); if (close) { channelManager.closeChannel(channel); } else { channelManager.tryToOfferChannelToPool(channel, future.getAsyncHandler(), true, future.getPartitionKey()); } try { future.done(); } catch (Exception t) { // Never propagate exception once we know we are done. logger.debug(t.getMessage(), t); } }
public void acquirePartitionLockLazily() throws IOException { if (connectionSemaphore == null || partitionKeyLock != null) { return; } Object partitionKey = getPartitionKey(); connectionSemaphore.acquireChannelLock(partitionKey); Object prevKey = PARTITION_KEY_LOCK_FIELD.getAndSet(this, partitionKey); if (prevKey != null) { // self-check connectionSemaphore.releaseChannelLock(prevKey); releasePartitionKeyLock(); throw new IllegalStateException("Trying to acquire partition lock concurrently. Please report."); } if (isDone()) { // may be cancelled while we acquired a lock releasePartitionKeyLock(); } }
final Object initialPartitionKey = future.getPartitionKey();
public void drainChannelAndOffer(final Channel channel, final NettyResponseFuture<?> future) { drainChannelAndOffer(channel, future, future.isKeepAlive(), future.getPartitionKey()); }
public void drainChannelAndOffer(final Channel channel, final NettyResponseFuture<?> future) { drainChannelAndOffer(channel, future, future.isKeepAlive(), future.getPartitionKey()); }
public void drainChannelAndOffer(final Channel channel, final NettyResponseFuture<?> future) { drainChannelAndOffer(channel, future, future.isKeepAlive(), future.getPartitionKey()); }
public void drainChannelAndOffer(final Channel channel, final NettyResponseFuture<?> future) { drainChannelAndOffer(channel, future, future.isKeepAlive(), future.getPartitionKey()); }
private void finishUpdate(final NettyResponseFuture<?> future, Channel channel, boolean expectOtherChunks) throws IOException { future.cancelTimeouts(); boolean keepAlive = future.isKeepAlive(); if (expectOtherChunks && keepAlive) channelManager.drainChannelAndOffer(channel, future); else channelManager.tryToOfferChannelToPool(channel, keepAlive, future.getPartitionKey()); try { future.done(); } catch (Throwable t) { // Never propagate exception once we know we are done. logger.debug(t.getMessage(), t); } }
private void finishUpdate(final NettyResponseFuture<?> future, Channel channel, boolean expectOtherChunks) throws IOException { future.cancelTimeouts(); boolean keepAlive = future.isKeepAlive(); if (expectOtherChunks && keepAlive) channelManager.drainChannelAndOffer(channel, future); else channelManager.tryToOfferChannelToPool(channel, keepAlive, future.getPartitionKey()); try { future.done(); } catch (Throwable t) { // Never propagate exception once we know we are done. logger.debug(t.getMessage(), t); } }
private void finishUpdate(final NettyResponseFuture<?> future, Channel channel, boolean expectOtherChunks) { future.cancelTimeouts(); boolean keepAlive = future.isKeepAlive(); if (expectOtherChunks && keepAlive) channelManager.drainChannelAndOffer(channel, future); else channelManager.tryToOfferChannelToPool(channel, future.getAsyncHandler(), keepAlive, future.getPartitionKey()); try { future.done(); } catch (Exception t) { // Never propagate exception once we know we are done. logger.debug(t.getMessage(), t); } }
private void finishUpdate(final NettyResponseFuture<?> future, Channel channel, boolean expectOtherChunks) throws IOException { future.cancelTimeouts(); boolean keepAlive = future.isKeepAlive(); if (expectOtherChunks && keepAlive) channelManager.drainChannelAndOffer(channel, future); else channelManager.tryToOfferChannelToPool(channel, future.getAsyncHandler(), keepAlive, future.getPartitionKey()); try { future.done(); } catch (Exception t) { // Never propagate exception once we know we are done. logger.debug(t.getMessage(), t); } }
Object partitionKey = future.getPartitionKey();
Object partitionKey = future.getPartitionKey();
Object partitionKey = future.getPartitionKey();
Object partitionKey = future.getPartitionKey();
final Object initialPartitionKey = future.getPartitionKey();
final Object initialPartitionKey = future.getPartitionKey();
final Object initialPartitionKey = future.getPartitionKey();
final Object initialPartitionKey = future.getPartitionKey();