Class MockInternalClusterInfoService

java.lang.Object
org.opensearch.cluster.InternalClusterInfoService
org.opensearch.cluster.MockInternalClusterInfoService
All Implemented Interfaces:
org.opensearch.cluster.ClusterInfoService, org.opensearch.cluster.ClusterStateListener

public class MockInternalClusterInfoService
extends org.opensearch.cluster.InternalClusterInfoService
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  MockInternalClusterInfoService.TestPlugin
    This is a marker plugin used to trigger MockNode to use this mock info service.
  • Field Summary

    Fields inherited from class org.opensearch.cluster.InternalClusterInfoService

    INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING, INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING
  • Constructor Summary

    Constructors 
    Constructor Description
    MockInternalClusterInfoService​(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.client.node.NodeClient client)  
  • Method Summary

    Modifier and Type Method Description
    org.opensearch.cluster.ClusterInfo getClusterInfo()  
    void setDiskUsageFunctionAndRefresh​(java.util.function.BiFunction<org.opensearch.cluster.node.DiscoveryNode,​org.opensearch.monitor.fs.FsInfo.Path,​org.opensearch.monitor.fs.FsInfo.Path> diskUsageFunction)  
    void setShardSizeFunctionAndRefresh​(java.util.function.Function<org.opensearch.cluster.routing.ShardRouting,​java.lang.Long> shardSizeFunction)  
    void setUpdateFrequency​(org.opensearch.common.unit.TimeValue updateFrequency)  

    Methods inherited from class org.opensearch.cluster.InternalClusterInfoService

    addListener, clusterChanged, refresh, updateIndicesStats, updateNodeStats

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockInternalClusterInfoService

      public MockInternalClusterInfoService​(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.threadpool.ThreadPool threadPool, org.opensearch.client.node.NodeClient client)
  • Method Details

    • setDiskUsageFunctionAndRefresh

      public void setDiskUsageFunctionAndRefresh​(java.util.function.BiFunction<org.opensearch.cluster.node.DiscoveryNode,​org.opensearch.monitor.fs.FsInfo.Path,​org.opensearch.monitor.fs.FsInfo.Path> diskUsageFunction)
    • setShardSizeFunctionAndRefresh

      public void setShardSizeFunctionAndRefresh​(java.util.function.Function<org.opensearch.cluster.routing.ShardRouting,​java.lang.Long> shardSizeFunction)
    • getClusterInfo

      public org.opensearch.cluster.ClusterInfo getClusterInfo()
      Specified by:
      getClusterInfo in interface org.opensearch.cluster.ClusterInfoService
      Overrides:
      getClusterInfo in class org.opensearch.cluster.InternalClusterInfoService
    • setUpdateFrequency

      public void setUpdateFrequency​(org.opensearch.common.unit.TimeValue updateFrequency)