private Engine.NoOpResult noOp(Engine engine, Engine.NoOp noOp) { active.set(true); if (logger.isTraceEnabled()) { logger.trace("noop (seq# [{}])", noOp.seqNo()); } return engine.noOp(noOp); }
private NoOpResult innerNoOp(final NoOp noOp) throws IOException { assert readLock.isHeldByCurrentThread() || writeLock.isHeldByCurrentThread(); assert noOp.seqNo() > SequenceNumbers.NO_OPS_PERFORMED; final long seqNo = noOp.seqNo(); try (Releasable ignored = noOpKeyedLock.acquire(seqNo)) { final NoOpResult noOpResult; final Optional<Exception> preFlightError = preFlightCheckForNoOp(noOp); if (preFlightError.isPresent()) { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), preFlightError.get()); } else { Exception failure = null; try { final ParsedDocument tombstone = engineConfig.getTombstoneDocSupplier().newNoopTombstoneDoc(noOp.reason()); tombstone.updateSeqID(noOp.seqNo(), noOp.primaryTerm()); noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo()); } else { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), failure); final Translog.Location location = translog.add(new Translog.NoOp(noOp.seqNo(), noOp.primaryTerm(), noOp.reason())); noOpResult.setTranslogLocation(location);
private Engine.NoOpResult noOp(Engine engine, Engine.NoOp noOp) { active.set(true); if (logger.isTraceEnabled()) { logger.trace("noop (seq# [{}])", noOp.seqNo()); } return engine.noOp(noOp); }
private NoOpResult innerNoOp(final NoOp noOp) throws IOException { assert readLock.isHeldByCurrentThread() || writeLock.isHeldByCurrentThread(); assert noOp.seqNo() > SequenceNumbers.NO_OPS_PERFORMED; final long seqNo = noOp.seqNo(); try (Releasable ignored = noOpKeyedLock.acquire(seqNo)) { final NoOpResult noOpResult; final Optional<Exception> preFlightError = preFlightCheckForNoOp(noOp); if (preFlightError.isPresent()) { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), preFlightError.get()); } else { Exception failure = null; try { final ParsedDocument tombstone = engineConfig.getTombstoneDocSupplier().newNoopTombstoneDoc(noOp.reason()); tombstone.updateSeqID(noOp.seqNo(), noOp.primaryTerm()); noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo()); } else { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), failure); final Translog.Location location = translog.add(new Translog.NoOp(noOp.seqNo(), noOp.primaryTerm(), noOp.reason())); noOpResult.setTranslogLocation(location);
@Override public NoOpResult noOp(final NoOp noOp) { NoOpResult noOpResult; try (ReleasableLock ignored = readLock.acquire()) { noOpResult = innerNoOp(noOp); } catch (final Exception e) { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), e); } return noOpResult; }
@Override public NoOpResult noOp(final NoOp noOp) { NoOpResult noOpResult; try (ReleasableLock ignored = readLock.acquire()) { noOpResult = innerNoOp(noOp); } catch (final Exception e) { noOpResult = new NoOpResult(getPrimaryTerm(), noOp.seqNo(), e); } return noOpResult; }