Class BaseNodesResponse<TNodeResponse extends BaseNodeResponse>

java.lang.Object
All Implemented Interfaces:
Writeable, org.elasticsearch.common.util.concurrent.RefCounted
Direct Known Subclasses:
ClusterStatsResponse, FindDanglingIndexResponse, ListDanglingIndicesResponse, NodesHotThreadsResponse, NodesInfoResponse, NodesReloadSecureSettingsResponse, NodesStatsResponse, NodesUsageResponse, TransportNodesListGatewayMetaState.NodesGatewayMetaState, TransportNodesListGatewayStartedShards.NodesGatewayStartedShards, TransportNodesListShardStoreMetadata.NodesStoreFilesMetadata, TransportNodesSnapshotsStatus.NodesSnapshotStatus

public abstract class BaseNodesResponse<TNodeResponse extends BaseNodeResponse>
extends ActionResponse
  • Constructor Details

    • BaseNodesResponse

      protected BaseNodesResponse​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
    • BaseNodesResponse

      protected BaseNodesResponse​(ClusterName clusterName, java.util.List<TNodeResponse> nodes, java.util.List<FailedNodeException> failures)
  • Method Details

    • getClusterName

      public ClusterName getClusterName()
      Get the ClusterName associated with all of the nodes.
      Returns:
      Never null.
    • failures

      public java.util.List<FailedNodeException> failures()
      Get the failed node exceptions.
      Returns:
      Never null. Can be empty.
    • hasFailures

      public boolean hasFailures()
      Determine if there are any node failures in failures.
      Returns:
      true if failures contains at least 1 FailedNodeException.
    • getNodes

      public java.util.List<TNodeResponse> getNodes()
      Get the successful node responses.
      Returns:
      Never null. Can be empty.
      See Also:
      hasFailures()
    • getNodesMap

      public java.util.Map<java.lang.String,​TNodeResponse> getNodesMap()
      Lazily build and get a map of Node ID to node response.
      Returns:
      Never null. Can be empty.
      See Also:
      getNodes()
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Throws:
      java.io.IOException
    • readNodesFrom

      protected abstract java.util.List<TNodeResponse> readNodesFrom​(StreamInput in) throws java.io.IOException
      Read the nodes from the stream.
      Returns:
      Never null.
      Throws:
      java.io.IOException
    • writeNodesTo

      protected abstract void writeNodesTo​(StreamOutput out, java.util.List<TNodeResponse> nodes) throws java.io.IOException
      Write the nodes to the stream.
      Throws:
      java.io.IOException