Use a dedicated ConnectionManger for RemoteClusterConnection#32988
Merged
s1monw merged 3 commits intoelastic:masterfrom Aug 21, 2018
Merged
Use a dedicated ConnectionManger for RemoteClusterConnection#32988s1monw merged 3 commits intoelastic:masterfrom
s1monw merged 3 commits intoelastic:masterfrom
Conversation
This change introduces a dedicated ConnectionManager for every RemoteClusterConnection such that there is not state shared with the TransportService internal ConnectionManager. All connections to a remote cluster are isolated from the TransportService but still uses the TransportService and it's internal properties like the Transport, tracing and internal listener actions on disconnects etc. This allows a remote cluster connection to have a different lifecycle than a local cluster connection, also local discovery code doesn't get notified if there is a disconnect on from a remote cluster and each connection can use it's own dedicated connection profile which allows to have a reduced set of connections per cluster without conflicting with the local cluster. Closes elastic#31835
Collaborator
|
Pinging @elastic/es-core-infra |
Tim-Brooks
approved these changes
Aug 20, 2018
| if (remote == null) { // this is a new cluster we have to add a new representation | ||
| remote = new RemoteClusterConnection(settings, entry.getKey(), entry.getValue(), transportService, numRemoteConnections, | ||
| remote = new RemoteClusterConnection(settings, entry.getKey(), entry.getValue(), transportService, | ||
| new ConnectionManager(settings, transportService.transport, transportService.threadPool),numRemoteConnections, |
Contributor
There was a problem hiding this comment.
You could pass the default "remote connection profile" in as a ctor argument.
Contributor
There was a problem hiding this comment.
Also some whitespace issues here.
ywelsch
reviewed
Aug 21, 2018
| public void addListener(TransportConnectionListener listener) { | ||
| this.connectionListener.listeners.add(listener); | ||
| if (connectionListener.listeners.contains(listener) == false) { | ||
| this.connectionListener.listeners.add(listener); |
Contributor
There was a problem hiding this comment.
as connectionListener.listeners is a CopyOnWriteArrayList, you can use addIfAbsent, which also has proper concurrency semantics
s1monw
added a commit
that referenced
this pull request
Aug 23, 2018
This change introduces a dedicated ConnectionManager for every RemoteClusterConnection such that there is not state shared with the TransportService internal ConnectionManager. All connections to a remote cluster are isolated from the TransportService but still uses the TransportService and it's internal properties like the Transport, tracing and internal listener actions on disconnects etc. This allows a remote cluster connection to have a different lifecycle than a local cluster connection, also local discovery code doesn't get notified if there is a disconnect on from a remote cluster and each connection can use it's own dedicated connection profile which allows to have a reduced set of connections per cluster without conflicting with the local cluster. Closes #31835
s1monw
added a commit
that referenced
this pull request
Aug 23, 2018
s1monw
added a commit
that referenced
this pull request
Aug 23, 2018
martijnvg
added a commit
that referenced
this pull request
Aug 24, 2018
* es/6.x: (58 commits) [DOCS] Add docs for Application Privileges (#32635) Add versions 5.6.12 and 6.4.1 [Rollup] Return empty response when aggs are missing (#32796) [TEST] Add some ACL yaml tests for Rollup (#33035) Test fix - GraphExploreResponseTests should not randomise array elements Closes #33086 Use `addIfAbsent` instead of checking if an element is contained HLRC: Fix Compile Error From Missing Throws (#33083) [DOCS] Remove reload password from docs cf. #32889 Use a dedicated ConnectionManger for RemoteClusterConnection (#32988) Watcher: Improve error messages for CronEvalTool (#32800) HLRC: Add ML Get Buckets API (#33056) Change query field expansion (#33020) Search: Support of wildcard on docvalue_fields (#32980) Add beta label to MSI on install Elasticsearch page (#28126) SQL: skip uppercasing/lowercasing function tests for AZ locales as well (#32910) [DOCS] Drafts Elasticsearch 6.4.0 release notes (#33039) Fix the default pom file name (#33063) Fix backport of switch ml basic tests to new style Requests (#32483) Switch ml basic tests to new style Requests (#32483) Switch some watcher tests to new style Requests (#33044) ...
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.
This change introduces a dedicated ConnectionManager for every RemoteClusterConnection
such that there is not state shared with the TransportService internal ConnectionManager.
All connections to a remote cluster are isolated from the TransportService but still uses
the TransportService and it's internal properties like the Transport, tracing and internal
listener actions on disconnects etc.
This allows a remote cluster connection to have a different lifecycle than a local cluster connection,
also local discovery code doesn't get notified if there is a disconnect on from a remote cluster and
each connection can use it's own dedicated connection profile which allows to have a reduced set of
connections per cluster without conflicting with the local cluster.
Closes #31835