Package org.elasticsearch.cluster
Class InternalClusterInfoService
java.lang.Object
org.elasticsearch.cluster.InternalClusterInfoService
- All Implemented Interfaces:
ClusterInfoService
,ClusterStateListener
public class InternalClusterInfoService extends java.lang.Object implements ClusterInfoService, ClusterStateListener
InternalClusterInfoService provides the ClusterInfoService interface,
routinely updated on a timer. The timer can be dynamically changed by
setting the
cluster.info.update.interval
setting (defaulting
to 30 seconds). The InternalClusterInfoService only runs on the master node.
Listens for changes in the number of data nodes and immediately submits a
ClusterInfoUpdateJob if a node has been added.
Every time the timer runs, gathers information about the disk usage and
shard sizes across the cluster.-
Field Summary
Fields Modifier and Type Field Description static Setting<org.elasticsearch.common.unit.TimeValue>
INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING
static Setting<org.elasticsearch.common.unit.TimeValue>
INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING
-
Constructor Summary
Constructors Constructor Description InternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, Client client)
-
Method Summary
Modifier and Type Method Description void
addListener(java.util.function.Consumer<ClusterInfo> clusterInfoConsumer)
Add a listener for new cluster informationvoid
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.ClusterInfo
getClusterInfo()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING
public static final Setting<org.elasticsearch.common.unit.TimeValue> INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING -
INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING
public static final Setting<org.elasticsearch.common.unit.TimeValue> INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING
-
-
Constructor Details
-
InternalClusterInfoService
public InternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, Client client)
-
-
Method Details
-
clusterChanged
Description copied from interface:ClusterStateListener
Called when cluster state changes.- Specified by:
clusterChanged
in interfaceClusterStateListener
-
getClusterInfo
- Specified by:
getClusterInfo
in interfaceClusterInfoService
- Returns:
- the latest cluster information
-
addListener
Description copied from interface:ClusterInfoService
Add a listener for new cluster information- Specified by:
addListener
in interfaceClusterInfoService
-