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 
    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.transport.client.node.NodeClient client)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opensearch.cluster.ClusterInfo
     
    void
    setDiskUsageFunctionAndRefresh(BiFunction<org.opensearch.cluster.node.DiscoveryNode, org.opensearch.monitor.fs.FsInfo.Path, org.opensearch.monitor.fs.FsInfo.Path> diskUsageFunction)
     
    void
    setNodeResourceUsageFunctionAndRefresh(Function<String, org.opensearch.node.NodeResourceUsageStats> resourceUsageFunction)
     
    void
    setShardSizeFunctionAndRefresh(Function<org.opensearch.cluster.routing.ShardRouting, 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.transport.client.node.NodeClient client)
  • Method Details

    • setDiskUsageFunctionAndRefresh

      public void setDiskUsageFunctionAndRefresh(BiFunction<org.opensearch.cluster.node.DiscoveryNode, org.opensearch.monitor.fs.FsInfo.Path, org.opensearch.monitor.fs.FsInfo.Path> diskUsageFunction)
    • setNodeResourceUsageFunctionAndRefresh

      public void setNodeResourceUsageFunctionAndRefresh(Function<String, org.opensearch.node.NodeResourceUsageStats> resourceUsageFunction)
    • setShardSizeFunctionAndRefresh

      public void setShardSizeFunctionAndRefresh(Function<org.opensearch.cluster.routing.ShardRouting, 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)