Example #1
0
    private void onCardinality() {
      recoveryRetransmitter.stop();
      recoveryRetransmitter = null;

      if (answerFromLeader == null) {
        Recovery recovery = new Recovery(-1, localEpochNumber);
        recoveryRetransmitter = retransmitter.startTransmitting(recovery);
      } else {
        startCatchup((int) answerFromLeader.getNextId());
        Network.removeMessageListener(MessageType.RecoveryAnswer, this);
      }
    }
Example #2
0
  public void run() {
    // do not execute recovery mechanism on first run
    localEpochNumber = storage.getEpoch()[localId];
    if (localEpochNumber == 1) {
      onRecoveryFinished();
      return;
    }

    retransmitter = new ActiveRetransmitter(paxos.getNetwork());
    logger.info("Sending recovery message");
    Network.addMessageListener(MessageType.RecoveryAnswer, new RecoveryAnswerListener());
    recoveryRetransmitter = retransmitter.startTransmitting(new Recovery(-1, localEpochNumber));
  }
Example #3
0
 private void onRecoveryFinished() {
   fireRecoveryListener();
   Network.addMessageListener(MessageType.Recovery, new EpochRecoveryRequestHandler(paxos));
 }