示例#1
0
 public EpochSSRecovery(SnapshotProvider snapshotProvider, String logPath) throws IOException {
   epochFile = new SingleNumberWriter(logPath, EPOCH_FILE_NAME);
   localId = ProcessDescriptor.getInstance().localId;
   numReplicas = ProcessDescriptor.getInstance().numReplicas;
   storage = createStorage();
   paxos = createPaxos(snapshotProvider, storage);
   dispatcher = paxos.getDispatcher();
 }
示例#2
0
 // Get all instances before <code>nextId</code>
 private void startCatchup(final int nextId) {
   new RecoveryCatchUp(paxos.getCatchup(), storage)
       .recover(
           nextId,
           new Runnable() {
             public void run() {
               onRecoveryFinished();
             }
           });
 }
示例#3
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));
  }