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.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
-
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
Constructors Modifier Constructor Description protectedBaseNodesResponse(ClusterName clusterName, java.util.List<TNodeResponse> nodes, java.util.List<FailedNodeException> failures)protectedBaseNodesResponse(StreamInput in) -
Method Summary
Modifier and Type Method Description java.util.List<FailedNodeException>failures()Get the failed node exceptions.ClusterNamegetClusterName()Get theClusterNameassociated with all of the nodes.java.util.List<TNodeResponse>getNodes()Get the successful node responses.java.util.Map<java.lang.String,TNodeResponse>getNodesMap()Lazily build and get a map of Node ID to node response.booleanhasFailures()Determine if there are any node failures infailures.protected abstract java.util.List<TNodeResponse>readNodesFrom(StreamInput in)Read thenodesfrom the stream.protected abstract voidwriteNodesTo(StreamOutput out, java.util.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, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BaseNodesResponse
- Throws:
java.io.IOException
-
BaseNodesResponse
protected BaseNodesResponse(ClusterName clusterName, java.util.List<TNodeResponse> nodes, java.util.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:
java.io.IOException
-
readNodesFrom
protected abstract java.util.List<TNodeResponse> readNodesFrom(StreamInput in) throws java.io.IOExceptionRead thenodesfrom the stream.- Returns:
- Never
null. - Throws:
java.io.IOException
-
writeNodesTo
protected abstract void writeNodesTo(StreamOutput out, java.util.List<TNodeResponse> nodes) throws java.io.IOExceptionWrite thenodesto the stream.- Throws:
java.io.IOException
-