Package org.elasticsearch.discovery
Class BlockingClusterStatePublishResponseHandler
java.lang.Object
org.elasticsearch.discovery.BlockingClusterStatePublishResponseHandler
- Direct Known Subclasses:
AckClusterStatePublishResponseHandler
Handles responses obtained when publishing a new cluster state from master to all non master nodes.
Allows to await a reply from all non master nodes, up to a timeout
-
Constructor Summary
ConstructorDescriptionBlockingClusterStatePublishResponseHandler(Set<DiscoveryNode> publishingToNodes)
Creates a new BlockingClusterStatePublishResponseHandler -
Method Summary
Modifier and TypeMethodDescriptionboolean
awaitAllNodes(org.elasticsearch.core.TimeValue timeout)
Allows to wait for all non master nodes to reply to the publish event up to a timeoutreturns a set of nodes for which publication has failed.void
onFailure(DiscoveryNode node, Exception e)
Called for each failure obtained from non master nodesvoid
onResponse(DiscoveryNode node)
Called for each response obtained from non master nodesreturns a list of nodes which didn't respond yet
-
Constructor Details
-
BlockingClusterStatePublishResponseHandler
Creates a new BlockingClusterStatePublishResponseHandler- Parameters:
publishingToNodes
- the set of nodes to which the cluster state will be published and should respond
-
-
Method Details
-
onResponse
Called for each response obtained from non master nodes- Parameters:
node
- the node that replied to the publish event
-
onFailure
Called for each failure obtained from non master nodes- Parameters:
node
- the node that replied to the publish event
-
awaitAllNodes
Allows to wait for all non master nodes to reply to the publish event up to a timeout- Parameters:
timeout
- the timeout- Returns:
- true if the timeout expired or not, false otherwise
- Throws:
InterruptedException
-
pendingNodes
returns a list of nodes which didn't respond yet -
getFailedNodes
returns a set of nodes for which publication has failed.
-