Class BaseNodesResponse<TNodeResponse extends BaseNodeResponse>
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.support.nodes.BaseNodesResponse<TNodeResponse>
- All Implemented Interfaces:
Writeable,org.elasticsearch.core.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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseNodesResponse(ClusterName clusterName, List<TNodeResponse> nodes, List<FailedNodeException> failures)protected -
Method Summary
Modifier and TypeMethodDescriptionfailures()Get the failed node exceptions.Get theClusterNameassociated with all of the nodes.getNodes()Get the successful node responses.Lazily build and get a map of Node ID to node response.booleanDetermine if there are any node failures infailures.protected abstract List<TNodeResponse>Read thenodesfrom the stream.protected abstract voidwriteNodesTo(StreamOutput out, List<TNodeResponse> nodes)Write thenodesto the stream.voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, incRef, remoteAddress, remoteAddress, tryIncRef
-
Constructor Details
-
BaseNodesResponse
- Throws:
IOException
-
BaseNodesResponse
protected BaseNodesResponse(ClusterName clusterName, List<TNodeResponse> nodes, List<FailedNodeException> failures)
-
-
Method Details
-
getClusterName
Get theClusterNameassociated with all of the nodes.- Returns:
- Never
null.
-
failures
Get the failed node exceptions.- Returns:
- Never
null. Can be empty.
-
hasFailures
public boolean hasFailures()Determine if there are any node failures infailures.- Returns:
trueiffailurescontains at least 1FailedNodeException.
-
getNodes
Get the successful node responses.- Returns:
- Never
null. Can be empty. - See Also:
hasFailures()
-
getNodesMap
Lazily build and get a map of Node ID to node response.- Returns:
- Never
null. Can be empty. - See Also:
getNodes()
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
readNodesFrom
Read thenodesfrom the stream.- Returns:
- Never
null. - Throws:
IOException
-
writeNodesTo
protected abstract void writeNodesTo(StreamOutput out, List<TNodeResponse> nodes) throws IOExceptionWrite thenodesto the stream.- Throws:
IOException
-