java.io.Closeable
, java.lang.AutoCloseable
public final class RemoteClusterService extends RemoteClusterAware implements java.io.Closeable
Modifier and Type | Field | 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.
|
deprecationLogger, logger, settings
clusterNameResolver, LOCAL_CLUSTER_GROUP_KEY, REMOTE_CLUSTER_INDEX_SEPARATOR, REMOTE_CLUSTERS_SEEDS
Modifier and Type | Method | 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(java.lang.String cluster) |
|
Transport.Connection |
getConnection(DiscoveryNode node,
java.lang.String cluster) |
Returns a connection to the given node on the given remote cluster
|
Client |
getRemoteClusterClient(ThreadPool threadPool,
java.lang.String clusterAlias) |
Returns a client to the remote cluster if the given cluster alias exists.
|
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.
|
logDeprecatedSetting, logRemovedSetting, nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildRemoteClustersSeeds, buildRemoteIndexName, groupClusterIndices
public 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 true
public 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 RemoteClusterAware
public void listenForUpdates(ClusterSettings clusterSettings)
RemoteClusterAware
listenForUpdates
in class RemoteClusterAware
protected void updateRemoteCluster(java.lang.String clusterAlias, java.util.List<java.net.InetSocketAddress> addresses)
RemoteClusterAware
updateRemoteCluster
in class RemoteClusterAware
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException
public 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.public Client getRemoteClusterClient(ThreadPool threadPool, java.lang.String clusterAlias)
threadPool
- the ThreadPool
for the clientclusterAlias
- the cluster alias the remote cluster is registered underjava.lang.IllegalArgumentException
- if the given clusterAlias doesn't exist