Class RemoteClusterAware

  • Direct Known Subclasses:

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


        public static final Setting.AffixSetting<java.util.List<java.lang.String>> SEARCH_REMOTE_CLUSTERS_SEEDS

        public static final SettingUpgrader<java.util.List<java.lang.String>> SEARCH_REMOTE_CLUSTER_SEEDS_UPGRADER

        public static final Setting.AffixSetting<java.util.List<java.lang.String>> REMOTE_CLUSTERS_SEEDS
        A list of initial seed nodes to discover eligible nodes from the remote cluster

        public static final char REMOTE_CLUSTER_INDEX_SEPARATOR
        See Also:
        Constant Field Values

        public static final java.lang.String LOCAL_CLUSTER_GROUP_KEY
        See Also:
        Constant Field Values

        public static final Setting.AffixSetting<java.lang.String> SEARCH_REMOTE_CLUSTERS_PROXY

        public static final SettingUpgrader<java.lang.String> SEARCH_REMOTE_CLUSTERS_PROXY_UPGRADER

        public static final Setting.AffixSetting<java.lang.String> REMOTE_CLUSTERS_PROXY
        A proxy address for the remote cluster. NOTE: this settings is undocumented until we have at last one transport that supports passing on the hostname via a mechanism like SNI.
      • settings

        protected final Settings settings
    • Constructor Detail

      • RemoteClusterAware

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

      • buildRemoteClustersDynamicConfig

        protected static java.util.Map<java.lang.String,​Tuple<java.lang.String,​java.util.List<Tuple<java.lang.String,​java.util.function.Supplier<DiscoveryNode>>>>> buildRemoteClustersDynamicConfig​(Settings settings)
        Builds the dynamic per-cluster config from the given settings. This is a map keyed by the cluster alias that points to a tuple (ProxyAddresss, [SeedNodeSuppliers]). If a cluster is configured with a proxy address all seed nodes will point to TransportAddress.META_ADDRESS and their configured address will be used as the hostname for the generated discovery node.
      • groupClusterIndices

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> groupClusterIndices​(java.util.Set<java.lang.String> remoteClusterNames,
                                                                                                             java.lang.String[] requestIndices,
                                                                                                             java.util.function.Predicate<java.lang.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​(java.lang.String clusterAlias,
                                                    java.util.List<java.lang.String> addresses,
                                                    java.lang.String proxy,
                                                    boolean compressionEnabled,
                                                    TimeValue pingSchedule)
        Subclasses must implement this to receive information about updated cluster aliases. If the given address list is empty the cluster alias is unregistered and should be removed.
      • listenForUpdates

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

        public static Tuple<java.lang.String,​java.lang.Integer> parseHostPort​(java.lang.String remoteHost)
      • buildRemoteIndexName

        public static java.lang.String buildRemoteIndexName​(java.lang.String clusterAlias,
                                                            java.lang.String indexName)