All Implemented Interfaces:
Writeable, RefCounted, TaskAwareRequest

public class NodesStatsRequest extends BaseNodesRequest<NodesStatsRequest>
A request to get node (cluster) level stats.
  • Constructor Details

    • NodesStatsRequest

      public NodesStatsRequest()
    • NodesStatsRequest

      public NodesStatsRequest(StreamInput in) throws IOException
      Throws:
      IOException
    • NodesStatsRequest

      public NodesStatsRequest(String... nodesIds)
      Get stats from nodes based on the nodes ids specified. If none are passed, stats for all nodes will be returned.
    • NodesStatsRequest

      public NodesStatsRequest(NodesStatsRequestParameters nodesStatsRequestParameters, String... nodesIds)
  • Method Details

    • all

      public NodesStatsRequest all()
      Sets all the request flags.
    • clear

      public NodesStatsRequest clear()
      Clears all the request flags.
    • indices

      public CommonStatsFlags indices()
      Get nodesStatsMetrics.indices(). Handles separately from other metrics because it may or may not have submetrics.
      Returns:
      flags indicating which indices stats to return
    • indices

      public NodesStatsRequest indices(CommonStatsFlags indices)
      Set nodesStatsMetrics.indices(). Handles separately from other metrics because it may or may not involve submetrics.
      Parameters:
      indices - flags indicating which indices stats to return
      Returns:
      This object, for request chaining.
    • indices

      public NodesStatsRequest indices(boolean indices)
      Should indices stats be returned.
    • requestedMetrics

      public Set<String> requestedMetrics()
      Get the names of requested metrics, excluding indices, which are handled separately.
    • addMetric

      public NodesStatsRequest addMetric(String metric)
      Add metric
    • addMetrics

      public NodesStatsRequest addMetrics(String... metrics)
      Add an array of metric names
    • removeMetric

      public NodesStatsRequest removeMetric(String metric)
      Remove metric
    • getDescription

      public String getDescription()
      Description copied from interface: TaskAwareRequest
      Returns optional description of the request to be displayed by the task manager
    • createTask

      public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String,String> headers)
      Description copied from interface: TaskAwareRequest
      Returns the task object that should be used to keep track of the processing of the request.
    • includeShardsStats

      public boolean includeShardsStats()
    • setIncludeShardsStats

      public void setIncludeShardsStats(boolean includeShardsStats)
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class BaseNodesRequest<NodesStatsRequest>
      Throws:
      IOException
    • getNodesStatsRequestParameters

      public NodesStatsRequestParameters getNodesStatsRequestParameters()