public final class RemoteClusterService extends RemoteClusterAware implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
static Setting<java.lang.Boolean> |
ENABLE_REMOTE_CLUSTERS
If
true connecting to remote clusters is supported on this node. |
static Setting.AffixSetting<java.lang.Boolean> |
REMOTE_CLUSTER_SKIP_UNAVAILABLE |
static Setting<java.lang.Integer> |
REMOTE_CONNECTIONS_PER_CLUSTER
The maximum number of connections that will be established to a remote cluster.
|
static Setting<TimeValue> |
REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING
The initial connect timeout for remote cluster connections
|
static Setting<java.lang.String> |
REMOTE_NODE_ATTRIBUTE
The name of a node attribute to select nodes that should be connected to in the remote cluster.
|
clusterNameResolver, LOCAL_CLUSTER_GROUP_KEY, REMOTE_CLUSTER_INDEX_SEPARATOR, REMOTE_CLUSTERS_SEEDSdeprecationLogger, logger, settings| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
collectNodes(java.util.Set<java.lang.String> clusters,
ActionListener<java.util.function.BiFunction<java.lang.String,java.lang.String,DiscoveryNode>> listener)
Collects all nodes of the given clusters and returns / passes a (clusterAlias, nodeId) to
DiscoveryNode
function on success. |
void |
collectSearchShards(IndicesOptions indicesOptions,
java.lang.String preference,
java.lang.String routing,
java.util.Map<java.lang.String,OriginalIndices> remoteIndicesByCluster,
ActionListener<java.util.Map<java.lang.String,ClusterSearchShardsResponse>> listener) |
void |
ensureConnected(java.lang.String clusterAlias,
ActionListener<java.lang.Void> listener)
Ensures that the given cluster alias is connected.
|
Transport.Connection |
getConnection(DiscoveryNode node,
java.lang.String cluster)
Returns a connection to the given node on the given remote cluster
|
Transport.Connection |
getConnection(java.lang.String cluster) |
protected java.util.Set<java.lang.String> |
getRemoteClusterNames() |
void |
getRemoteConnectionInfos(ActionListener<java.util.Collection<RemoteConnectionInfo>> listener) |
java.util.Map<java.lang.String,OriginalIndices> |
groupIndices(IndicesOptions indicesOptions,
java.lang.String[] indices,
java.util.function.Predicate<java.lang.String> indexExists) |
boolean |
isCrossClusterSearchEnabled()
Returns
true if at least one remote cluster is configured |
void |
listenForUpdates(ClusterSettings clusterSettings)
Registers this instance to listen to updates on the cluster settings.
|
protected void |
updateRemoteCluster(java.lang.String clusterAlias,
java.util.List<java.net.InetSocketAddress> addresses)
Subclasses must implement this to receive information about updated cluster aliases.
|
buildRemoteClustersSeeds, buildRemoteIndexName, groupClusterIndiceslogDeprecatedSetting, logRemovedSetting, nodeNamepublic static final Setting<java.lang.Integer> REMOTE_CONNECTIONS_PER_CLUSTER
public static final Setting<TimeValue> REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING
public static final Setting<java.lang.String> REMOTE_NODE_ATTRIBUTE
public static final Setting<java.lang.Boolean> ENABLE_REMOTE_CLUSTERS
true connecting to remote clusters is supported on this node. If false this node will not establish
connections to any remote clusters configured. Search requests executed against this node (where this node is the coordinating node)
will fail if remote cluster syntax is used as an index pattern. The default is truepublic static final Setting.AffixSetting<java.lang.Boolean> REMOTE_CLUSTER_SKIP_UNAVAILABLE
public boolean isCrossClusterSearchEnabled()
true if at least one remote cluster is configuredpublic java.util.Map<java.lang.String,OriginalIndices> groupIndices(IndicesOptions indicesOptions, java.lang.String[] indices, java.util.function.Predicate<java.lang.String> indexExists)
public void collectSearchShards(IndicesOptions indicesOptions, java.lang.String preference, java.lang.String routing, java.util.Map<java.lang.String,OriginalIndices> remoteIndicesByCluster, ActionListener<java.util.Map<java.lang.String,ClusterSearchShardsResponse>> listener)
public Transport.Connection getConnection(DiscoveryNode node, java.lang.String cluster)
java.lang.IllegalArgumentException - if the remote cluster is unknownpublic void ensureConnected(java.lang.String clusterAlias,
ActionListener<java.lang.Void> listener)
public Transport.Connection getConnection(java.lang.String cluster)
protected java.util.Set<java.lang.String> getRemoteClusterNames()
getRemoteClusterNames in class RemoteClusterAwarepublic void listenForUpdates(ClusterSettings clusterSettings)
RemoteClusterAwarelistenForUpdates in class RemoteClusterAwareprotected void updateRemoteCluster(java.lang.String clusterAlias,
java.util.List<java.net.InetSocketAddress> addresses)
RemoteClusterAwareupdateRemoteCluster in class RemoteClusterAwarepublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void getRemoteConnectionInfos(ActionListener<java.util.Collection<RemoteConnectionInfo>> listener)
public void collectNodes(java.util.Set<java.lang.String> clusters,
ActionListener<java.util.function.BiFunction<java.lang.String,java.lang.String,DiscoveryNode>> listener)
DiscoveryNode
function on success.