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.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseNodesResponse(ClusterName clusterName, List<TNodeResponse> nodes, List<FailedNodeException> failures)
protected
-
Method Summary
Modifier and TypeMethodDescriptionfailures()
Get the failed node exceptions.Get theClusterName
associated with all of the nodes.getNodes()
Get the successful node responses.Lazily build and get a map of Node ID to node response.boolean
Determine if there are any node failures infailures
.protected abstract List<TNodeResponse>
Read thenodes
from the stream.protected abstract void
writeNodesTo(StreamOutput out, List<TNodeResponse> nodes)
Write thenodes
to the stream.void
writeTo(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 theClusterName
associated 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:
true
iffailures
contains 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:Writeable
Write this into the StreamOutput.- Throws:
IOException
-
readNodesFrom
Read thenodes
from the stream.- Returns:
- Never
null
. - Throws:
IOException
-
writeNodesTo
protected abstract void writeNodesTo(StreamOutput out, List<TNodeResponse> nodes) throws IOExceptionWrite thenodes
to the stream.- Throws:
IOException
-