Class BlockingClusterStatePublishResponseHandler

org.elasticsearch.discovery.BlockingClusterStatePublishResponseHandler
Direct Known Subclasses:
AckClusterStatePublishResponseHandler

public class BlockingClusterStatePublishResponseHandler extends
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

    Constructors
    Constructor
    Description
    <DiscoveryNode> publishingToNodes)
    Creates a new BlockingClusterStatePublishResponseHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    awaitAllNodes​(org.elasticsearch.core.TimeValue timeout)
    Allows to wait for all non master nodes to reply to the publish event up to a timeout
    returns a set of nodes for which publication has failed.
    void
    onFailure​(DiscoveryNode node,  e)
    Called for each failure obtained from non master nodes
    void
    Called for each response obtained from non master nodes
    returns a list of nodes which didn't respond yet

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • BlockingClusterStatePublishResponseHandler

      public BlockingClusterStatePublishResponseHandler(<DiscoveryNode> publishingToNodes)
      Creates a new BlockingClusterStatePublishResponseHandler
      Parameters:
      publishingToNodes - the set of nodes to which the cluster state will be published and should respond
  • Method Details

    • onResponse

      public void onResponse(DiscoveryNode node)
      Called for each response obtained from non master nodes
      Parameters:
      node - the node that replied to the publish event
    • onFailure

      public void onFailure(DiscoveryNode node,  e)
      Called for each failure obtained from non master nodes
      Parameters:
      node - the node that replied to the publish event
    • awaitAllNodes

      public boolean awaitAllNodes(org.elasticsearch.core.TimeValue timeout) throws
      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:
    • pendingNodes

      public DiscoveryNode[] pendingNodes()
      returns a list of nodes which didn't respond yet
    • getFailedNodes

      public <DiscoveryNode> getFailedNodes()
      returns a set of nodes for which publication has failed.