Class RemoteClusterAware

Direct Known Subclasses:

public abstract class RemoteClusterAware extends Object
Base class for all services and components that need up-to-date information about the registered remote clusters
  • Field Details

  • Constructor Details

    • RemoteClusterAware

      protected RemoteClusterAware(Settings settings)
      Creates a new RemoteClusterAware instance
      settings - the nodes level settings
  • Method Details

    • getEnabledRemoteClusters

      protected static Set<String> getEnabledRemoteClusters(Settings settings)
      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 on REMOTE_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 under LOCAL_CLUSTER_GROUP_KEY. The returned map is mutable.
      remoteClusterNames - the remote cluster names
      requestIndices - the indices in the search request to filter
      indexExists - a predicate that can test if a certain index or alias exists in the local cluster
      a map of grouped remote and local indices
    • updateRemoteCluster

      protected abstract void updateRemoteCluster(String clusterAlias, Settings settings)
      Subclasses must implement this to receive information about updated cluster aliases.
    • listenForUpdates

      public void listenForUpdates(ClusterSettings clusterSettings)
      Registers this instance to listen to updates on the cluster settings.
    • buildRemoteIndexName

      public static String buildRemoteIndexName(String clusterAlias, String indexName)