Class ProposeCallback

  • All Implemented Interfaces:
    RequestCallback<java.lang.Boolean>

    public class ProposeCallback
    extends AbstractPaxosCallback<java.lang.Boolean>
    ProposeCallback has two modes of operation, controlled by the failFast parameter. In failFast mode, we will return a failure as soon as a majority of nodes reject the proposal. This is used when replaying a proposal from an earlier leader. Otherwise, we wait for either all replicas to respond or until we achieve the desired quorum. We continue to wait for all replicas even after we know we cannot succeed because we need to know if no node at all have accepted or if at least one has. In the former case, a proposer is guaranteed no-one will replay its value; in the latter we don't, so we must timeout in case another leader replays it before we can; see CASSANDRA-6013
    • Constructor Detail

      • ProposeCallback

        public ProposeCallback​(int totalTargets,
                               int requiredTargets,
                               boolean failFast,
                               ConsistencyLevel consistency,
                               long queryStartNanoTime)
    • Method Detail

      • onResponse

        public void onResponse​(Message<java.lang.Boolean> msg)
        Parameters:
        msg - response received.
      • getAcceptCount

        public int getAcceptCount()
      • isSuccessful

        public boolean isSuccessful()
      • isFullyRefused

        public boolean isFullyRefused()