Class RemoteClusterConnection

  • All Implemented Interfaces:, java.lang.AutoCloseable, TransportConnectionListener

    public final class RemoteClusterConnection
    extends java.lang.Object
    implements TransportConnectionListener,
    Represents a connection to a single remote cluster. In contrast to a local cluster a remote cluster is not joined such that the current node is part of the cluster and it won't receive cluster state updates from the remote cluster. Remote clusters are also not fully connected with the current node. From a connection perspective a local cluster forms a bi-directional star network while in the remote case we only connect to a subset of the nodes in the cluster in an uni-directional fashion. This class also handles the discovery of nodes from the remote cluster. The initial list of seed nodes is only used to discover all nodes in the remote cluster and connects to all eligible nodes, for details see RemoteClusterService.REMOTE_NODE_ATTRIBUTE. In the case of a disconnection, this class will issue a re-connect task to establish at most RemoteClusterService.REMOTE_CONNECTIONS_PER_CLUSTER until either all eligible nodes are exhausted or the maximum number of connections per cluster has been reached.
    • Field Detail


        public static final Setting<java.lang.Integer> REMOTE_MAX_PENDING_CONNECTION_LISTENERS
    • Method Detail

      • ensureConnected

        public void ensureConnected​(ActionListener<java.lang.Void> voidActionListener)
        Ensures that this cluster is connected. If the cluster is connected this operation will invoke the listener immediately.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • isClosed

        public boolean isClosed()
      • getProxyAddress

        public java.lang.String getProxyAddress()
      • getSeedNodes

        public java.util.List<Tuple<java.lang.String,​java.util.function.Supplier<DiscoveryNode>>> getSeedNodes()