Package org.elasticsearch.transport
Class RemoteClusterService
org.elasticsearch.transport.RemoteClusterAware
org.elasticsearch.transport.RemoteClusterService
- All Implemented Interfaces:
,
Basic service for accessing remote clusters via gateway nodes
-
Field Summary
Modifier and TypeFieldDescriptionstatic >
Iftrue
connecting to remote clusters is supported on this node.static Setting.AffixSetting<org.elasticsearch.core.TimeValue>
static >
static Setting<org.elasticsearch.core.TimeValue>
The initial connect timeout for remote cluster connectionsstatic >
The name of a node attribute to select nodes that should be connected to in the remote cluster.static >
static >
static >
static Setting<org.elasticsearch.core.TimeValue>
static >
Fields inherited from class org.elasticsearch.transport.RemoteClusterAware
LOCAL_CLUSTER_GROUP_KEY, REMOTE_CLUSTER_INDEX_SEPARATOR, settings
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
<> clusters, <,,DiscoveryNode>> listener)
Collects all nodes of the given clusters and returns / passes a (clusterAlias, nodeId) toDiscoveryNode
function on success.cluster)
getConnection(DiscoveryNode node, cluster)
Returns a connection to the given node on the given remote cluster<>
Returns the registered remote cluster names.getRemoteClusterClient(ThreadPool threadPool, clusterAlias)
Returns a client to the remote cluster if the given cluster alias exists.<,OriginalIndices>
groupIndices(IndicesOptions indicesOptions, [] indices, <> indexExists)
boolean
Returnstrue
if at least one remote cluster is configuredboolean
boolean
clusterAlias)
Returns whether the cluster identified by the provided alias is configured to be skipped when unavailablevoid
listenForUpdates(ClusterSettings clusterSettings)
Registers this instance to listen to updates on the cluster settings.protected void
clusterAlias, Settings settings)
Subclasses must implement this to receive information about updated cluster aliases.Methods inherited from class org.elasticsearch.transport.RemoteClusterAware
buildRemoteIndexName, getEnabledRemoteClusters, groupClusterIndices
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING
public static final Setting<org.elasticsearch.core.TimeValue> SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING -
REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING
public static final Setting<org.elasticsearch.core.TimeValue> REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTINGThe initial connect timeout for remote cluster connections -
SEARCH_REMOTE_NODE_ATTRIBUTE
public static final > SEARCH_REMOTE_NODE_ATTRIBUTE -
REMOTE_NODE_ATTRIBUTE
public static final > REMOTE_NODE_ATTRIBUTEThe name of a node attribute to select nodes that should be connected to in the remote cluster. For instance a node can be configured withnode.attr.gateway: true
in order to be eligible as a gateway node between clusters. In that casesearch.remote.node.attr: gateway
can be used to filter out other nodes in the remote cluster. The value of the setting is expected to be a boolean,true
for nodes that can become gateways,false
otherwise. -
SEARCH_ENABLE_REMOTE_CLUSTERS
public static final > SEARCH_ENABLE_REMOTE_CLUSTERS -
ENABLE_REMOTE_CLUSTERS
public static final > ENABLE_REMOTE_CLUSTERSIftrue
connecting to remote clusters is supported on this node. Iffalse
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 istrue
-
SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE
public static final > SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE -
SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE_UPGRADER
public static final > SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE_UPGRADER -
REMOTE_CLUSTER_SKIP_UNAVAILABLE
public static final > REMOTE_CLUSTER_SKIP_UNAVAILABLE -
REMOTE_CLUSTER_PING_SCHEDULE
public static final Setting.AffixSetting<org.elasticsearch.core.TimeValue> REMOTE_CLUSTER_PING_SCHEDULE -
REMOTE_CLUSTER_COMPRESS
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
getLocalNode
-
isCrossClusterSearchEnabled
public boolean isCrossClusterSearchEnabled()Returnstrue
if at least one remote cluster is configured -
groupIndices
-
getRegisteredRemoteClusterNames
public <> getRegisteredRemoteClusterNames()Returns the registered remote cluster names. -
getConnection
Returns a connection to the given node on the given remote cluster- Throws:
- if the remote cluster is unknown
-
getConnection
public cluster) -
listenForUpdates
Description copied from class:RemoteClusterAware
Registers this instance to listen to updates on the cluster settings.- Overrides:
listenForUpdates
in classRemoteClusterAware
-
updateRemoteCluster
Description copied from class:RemoteClusterAware
Subclasses must implement this to receive information about updated cluster aliases.- Specified by:
updateRemoteCluster
in classRemoteClusterAware
-
close
public void close() throws- Specified by:
in interface
- Specified by:
in interface
- Throws:
-
getRemoteConnectionInfos
-
collectNodes
Collects all nodes of the given clusters and returns / passes a (clusterAlias, nodeId) toDiscoveryNode
function on success. -
getRemoteClusterClient
Returns a client to the remote cluster if the given cluster alias exists.- Parameters:
threadPool
- theThreadPool
for the clientclusterAlias
- the cluster alias the remote cluster is registered under- Throws:
- if the given clusterAlias doesn't exist
-