Use PlainListenableActionFuture for CloseFuture#26242
Merged
Tim-Brooks merged 7 commits intoelastic:masterfrom Aug 18, 2017
Merged
Use PlainListenableActionFuture for CloseFuture#26242Tim-Brooks merged 7 commits intoelastic:masterfrom
Tim-Brooks merged 7 commits intoelastic:masterfrom
Conversation
Right now we use a custom future for the CloseFuture associated with a channel. This is because we need special unwrapping logic to ensure that exceptions from a future failure are a certain type (opposed to an UncategorizedException). However, the current version is limiting because we can only attach one listener. This commit changes the CloseFuture to extend the PlainListenableActionFuture. This change allows us to attach multiple listeners.
s1monw
suggested changes
Aug 18, 2017
|
|
||
| import java.util.function.Consumer; | ||
|
|
||
| public class ChannelConsumerAdaptor implements ActionListener<NioChannel> { |
Contributor
There was a problem hiding this comment.
can this be pkg private and final?
Contributor
There was a problem hiding this comment.
hmm can't we do:
NioChannel channel = ...;
Consumer<NioChannel> consumer = ...;
ActionListener<NioChannel> insteadOfAdaptor = ActionListener.wrap(consumer, e -> consumer.accept(channel));instead of having this adaptor class?
Contributor
Author
|
I explored this: The fact that |
Contributor
Author
|
Simon pointed out to me on Slack that I could pass the reference as |
Tim-Brooks
added a commit
that referenced
this pull request
Nov 8, 2017
Right now we use a custom future for the CloseFuture associated with a channel. This is because we need special unwrapping logic to ensure that exceptions from a future failure are a certain type (opposed to an UncategorizedException). However, the current version is limiting because we can only attach one listener. This commit changes the CloseFuture to extend the PlainListenableActionFuture. This change allows us to attach multiple listeners.
jasontedor
added a commit
that referenced
this pull request
Nov 9, 2017
* 6.x: Update Tika version to 1.15 Introduce templating support to timezone/locale in DateProcessor (#27089) Increase logging on qa:mixed-cluster tests Update to AWS SDK 1.11.223 (#27278) Improve error message for parse failures of completion fields (#27297) Remove optimisations to reuse objects when applying a new `ClusterState` (#27317) Decouple `ChannelFactory` from Tcp classes (#27286) Use PlainListenableActionFuture for CloseFuture (#26242) Fix find remote when building BWC Remove colons from task and configuration names Fix snapshot getting stuck in INIT state (#27214) Snapshot/Restore: better handle incorrect chunk_size settings in FS repo (#26844) Add unreleased 5.6.5 version number testCreateSplitIndexToN: do not set `routing_partition_size` to >= `number_of_routing_shards` Correct comment in index shard test Roll translog generation on primary promotion ObjectParser: Replace IllegalStateException with ParsingException (#27302) scripted_metric _agg parameter disappears if params are provided (#27159) Update discovery-ec2.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now we use a custom future for the
CloseFutureassociated with achannel. This is because we need special unwrapping logic to ensure that
exceptions from a future failure are a certain type (opposed to an
UncategorizedException). However, the current version is limitingbecause we can only attach one listener.
This commit changes the
CloseFutureto extend thePlainListenableActionFuture. This change allows us to attach multiplelisteners.