Package org.elasticsearch.cluster
Class MockInternalClusterInfoService
- java.lang.Object
-
- org.elasticsearch.cluster.InternalClusterInfoService
-
- org.elasticsearch.cluster.MockInternalClusterInfoService
-
- All Implemented Interfaces:
ClusterInfoService
,ClusterStateListener
,LocalNodeMasterListener
public class MockInternalClusterInfoService extends InternalClusterInfoService
Fake ClusterInfoService class that allows updating the nodes stats disk usage with fake values
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MockInternalClusterInfoService.DevNullClusterInfo
ClusterInfo that always points to DevNull.static class
MockInternalClusterInfoService.TestPlugin
This is a marker plugin used to trigger MockNode to use this mock info service.-
Nested classes/interfaces inherited from class org.elasticsearch.cluster.InternalClusterInfoService
InternalClusterInfoService.SubmitReschedulingClusterInfoUpdatedJob
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.cluster.InternalClusterInfoService
INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING, INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING
-
-
Constructor Summary
Constructors Constructor Description MockInternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, java.util.function.Consumer<ClusterInfo> listener)
-
Method Summary
Modifier and Type Method Description ClusterInfo
getClusterInfo()
static NodeStats
makeStats(java.lang.String nodeName, DiskUsage usage)
Create a fake NodeStats for the given node and usagevoid
setN1Usage(java.lang.String nodeName, DiskUsage newUsage)
void
setN2Usage(java.lang.String nodeName, DiskUsage newUsage)
void
setN3Usage(java.lang.String nodeName, DiskUsage newUsage)
void
setUpdateFrequency(TimeValue updateFrequency)
java.util.concurrent.CountDownLatch
updateIndicesStats(ActionListener<IndicesStatsResponse> listener)
java.util.concurrent.CountDownLatch
updateNodeStats(ActionListener<NodesStatsResponse> listener)
-
Methods inherited from class org.elasticsearch.cluster.InternalClusterInfoService
clusterChanged, executorName, offMaster, onMaster, refresh
-
-
-
-
Constructor Detail
-
MockInternalClusterInfoService
public MockInternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, java.util.function.Consumer<ClusterInfo> listener)
-
-
Method Detail
-
makeStats
public static NodeStats makeStats(java.lang.String nodeName, DiskUsage usage)
Create a fake NodeStats for the given node and usage
-
setN1Usage
public void setN1Usage(java.lang.String nodeName, DiskUsage newUsage)
-
setN2Usage
public void setN2Usage(java.lang.String nodeName, DiskUsage newUsage)
-
setN3Usage
public void setN3Usage(java.lang.String nodeName, DiskUsage newUsage)
-
updateNodeStats
public java.util.concurrent.CountDownLatch updateNodeStats(ActionListener<NodesStatsResponse> listener)
- Overrides:
updateNodeStats
in classInternalClusterInfoService
-
updateIndicesStats
public java.util.concurrent.CountDownLatch updateIndicesStats(ActionListener<IndicesStatsResponse> listener)
- Overrides:
updateIndicesStats
in classInternalClusterInfoService
-
getClusterInfo
public ClusterInfo getClusterInfo()
- Specified by:
getClusterInfo
in interfaceClusterInfoService
- Overrides:
getClusterInfo
in classInternalClusterInfoService
-
setUpdateFrequency
public void setUpdateFrequency(TimeValue updateFrequency)
-
-