private synchronized void checkWriteRequest(RequestInfo reqInfo) throws IOException { checkRequest(reqInfo); if (reqInfo.getEpoch() != lastWriterEpoch.get()) { throw new IOException("IPC's epoch " + reqInfo.getEpoch() + " is not the current writer epoch " + lastWriterEpoch.get() + " ; journal id: " + journalId); } }
final SegmentStateProto segment, final URL url) throws IOException { final File tmpFile = storage.getSyncLogTemporaryFile( segment.getStartTxId(), reqInfo.getEpoch()); final List<File> localPaths = ImmutableList.of(tmpFile);
if (reqInfo.getEpoch() < lastPromisedEpoch.get()) { throw new IOException("IPC's epoch " + reqInfo.getEpoch() + " is less than the last promised epoch " + lastPromisedEpoch.get() + " ; journal id: " + journalId); } else if (reqInfo.getEpoch() > lastPromisedEpoch.get()) { updateLastPromisedEpoch(reqInfo.getEpoch());
private QJournalProtocolProtos.RequestInfoProto convert( RequestInfo reqInfo) { RequestInfoProto.Builder builder = RequestInfoProto.newBuilder() .setJournalId(convertJournalId(reqInfo.getJournalId())) .setEpoch(reqInfo.getEpoch()) .setIpcSerialNumber(reqInfo.getIpcSerialNumber()); if (reqInfo.hasCommittedTxId()) { builder.setCommittedTxId(reqInfo.getCommittedTxId()); } if(reqInfo.getNameServiceId() != null) { builder.setNameServiceId(reqInfo.getNameServiceId()); } return builder.build(); }
final SegmentStateProto segment, final URL url) throws IOException { final File tmpFile = storage.getSyncLogTemporaryFile( segment.getStartTxId(), reqInfo.getEpoch()); final List<File> localPaths = ImmutableList.of(tmpFile);
final SegmentStateProto segment, final URL url) throws IOException { final File tmpFile = storage.getSyncLogTemporaryFile( segment.getStartTxId(), reqInfo.getEpoch()); final List<File> localPaths = ImmutableList.of(tmpFile);
private QJournalProtocolProtos.RequestInfoProto convert( RequestInfo reqInfo) { RequestInfoProto.Builder builder = RequestInfoProto.newBuilder() .setJournalId(convertJournalId(reqInfo.getJournalId())) .setEpoch(reqInfo.getEpoch()) .setIpcSerialNumber(reqInfo.getIpcSerialNumber()); if (reqInfo.hasCommittedTxId()) { builder.setCommittedTxId(reqInfo.getCommittedTxId()); } return builder.build(); }
private QJournalProtocolProtos.RequestInfoProto convert( RequestInfo reqInfo) { RequestInfoProto.Builder builder = RequestInfoProto.newBuilder() .setJournalId(convertJournalId(reqInfo.getJournalId())) .setEpoch(reqInfo.getEpoch()) .setIpcSerialNumber(reqInfo.getIpcSerialNumber()); if (reqInfo.hasCommittedTxId()) { builder.setCommittedTxId(reqInfo.getCommittedTxId()); } return builder.build(); }