Package org.elasticsearch.transport
Class RemoteClusterAware
java.lang.Object
org.elasticsearch.transport.RemoteClusterAware
- Direct Known Subclasses:
RemoteClusterService
Base class for all services and components that need up-to-date information about the registered remote clusters
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRemoteClusterAware(Settings settings)Creates a newRemoteClusterAwareinstance -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildRemoteIndexName(String clusterAlias, String indexName)getEnabledRemoteClusters(Settings settings)Returns remote clusters that are enabled in these settingsgroupClusterIndices(Set<String> remoteClusterNames, String[] requestIndices, Predicate<String> indexExists)Groups indices per cluster by splitting remote cluster-alias, index-name pairs onREMOTE_CLUSTER_INDEX_SEPARATOR.voidlistenForUpdates(ClusterSettings clusterSettings)Registers this instance to listen to updates on the cluster settings.protected abstract voidupdateRemoteCluster(String clusterAlias, Settings settings)Subclasses must implement this to receive information about updated cluster aliases.
-
Field Details
-
REMOTE_CLUSTER_INDEX_SEPARATOR
public static final char REMOTE_CLUSTER_INDEX_SEPARATOR- See Also:
- Constant Field Values
-
LOCAL_CLUSTER_GROUP_KEY
- See Also:
- Constant Field Values
-
settings
-
-
Constructor Details
-
RemoteClusterAware
Creates a newRemoteClusterAwareinstance- Parameters:
settings- the nodes level settings
-
-
Method Details
-
getEnabledRemoteClusters
Returns remote clusters that are enabled in these settings -
groupClusterIndices
protected Map<String,List<String>> groupClusterIndices(Set<String> remoteClusterNames, String[] requestIndices, Predicate<String> indexExists)Groups indices per cluster by splitting remote cluster-alias, index-name pairs onREMOTE_CLUSTER_INDEX_SEPARATOR. All indices per cluster are collected as a list in the returned map keyed by the cluster alias. Local indices are grouped underLOCAL_CLUSTER_GROUP_KEY. The returned map is mutable.- Parameters:
remoteClusterNames- the remote cluster namesrequestIndices- the indices in the search request to filterindexExists- a predicate that can test if a certain index or alias exists in the local cluster- Returns:
- a map of grouped remote and local indices
-
updateRemoteCluster
Subclasses must implement this to receive information about updated cluster aliases. -
listenForUpdates
Registers this instance to listen to updates on the cluster settings. -
buildRemoteIndexName
-