Package org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos

Examples of org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.PrepareRecoveryResponseProto


    checkJournalStorageFormatted();
    checkRequest(reqInfo);
   
    abortCurSegment();
   
    PrepareRecoveryResponseProto ret = new PrepareRecoveryResponseProto();

    PersistedRecoveryPaxosData previouslyAccepted = getPersistedPaxosData(segmentTxId);
    completeHalfDoneAcceptRecovery(previouslyAccepted);

    SegmentStateProto segInfo = getSegmentInfo(segmentTxId);
    boolean hasFinalizedSegment = segInfo != null && !segInfo.getIsInProgress();

    if (previouslyAccepted != null && !hasFinalizedSegment) {
      ret.setAcceptedInEpoch(previouslyAccepted.getAcceptedInEpoch());  
      ret.setSegmentState(previouslyAccepted.getSegmentState());
    } else {
      if (segInfo != null) {
        ret.setSegmentState(segInfo);
      }
    }
   
    ret.setLastWriterEpoch(lastWriterEpoch.get());
    if (committedTxnId.get() != HdfsConstants.INVALID_TXID) {
      ret.setLastCommittedTxId(committedTxnId.get());
    }
   
    LOG.info("Prepared recovery for segment " + segmentTxId + ": " + ret);
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos.PrepareRecoveryResponseProto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.