/** * A raw version of the commit id (see {@link SegmentInfos#getId()} */ public Engine.CommitId getRawCommitId() { return new Engine.CommitId(Base64.getDecoder().decode(id)); }
return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH; return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH;
pruneDeletedTombstones(); return new CommitId(newCommitId);
return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH; return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH;
return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH; return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH;
return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH; return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH;
@Override public CommitId flush(boolean force, boolean waitIfOngoing) throws EngineException { logger.trace("skipping FLUSH on shadow engine"); // reread the last committed segment infos refresh("flush"); /* * we have to inc-ref the store here since if the engine is closed by a tragic event * we don't acquire the write lock and wait until we have exclusive access. This might also * dec the store reference which can essentially close the store and unless we can inc the reference * we can't use it. */ store.incRef(); try (ReleasableLock lock = readLock.acquire()) { // reread the last committed segment infos lastCommittedSegmentInfos = readLastCommittedSegmentInfos(searcherManager, store); } catch (Throwable e) { if (isClosed.get() == false) { logger.warn("failed to read latest segment infos on flush", e); if (Lucene.isCorruptionException(e)) { throw new FlushFailedEngineException(shardId, e); } } } finally { store.decRef(); } return new CommitId(lastCommittedSegmentInfos.getId()); }
return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH; return SyncedFlushResult.PENDING_OPERATIONS; if (expectedCommitId.idsEqual(lastCommittedSegmentInfos.getId()) == false) { logger.trace("can't sync commit [{}]. current commit id is not equal to expected.", syncId); return SyncedFlushResult.COMMIT_MISMATCH;
@Override public CommitId flush(boolean force, boolean waitIfOngoing) throws EngineException { logger.trace("skipping FLUSH on shadow engine"); // reread the last committed segment infos refresh("flush"); /* * we have to inc-ref the store here since if the engine is closed by a tragic event * we don't acquire the write lock and wait until we have exclusive access. This might also * dec the store reference which can essentially close the store and unless we can inc the reference * we can't use it. */ store.incRef(); try (ReleasableLock lock = readLock.acquire()) { // reread the last committed segment infos lastCommittedSegmentInfos = readLastCommittedSegmentInfos(searcherManager, store); } catch (Exception e) { if (isClosed.get() == false) { logger.warn("failed to read latest segment infos on flush", e); if (Lucene.isCorruptionException(e)) { throw new FlushFailedEngineException(shardId, e); } } } finally { store.decRef(); } return new CommitId(lastCommittedSegmentInfos.getId()); }
@Override public CommitId flush(boolean force, boolean waitIfOngoing) throws EngineException { return new CommitId(lastCommittedSegmentInfos.getId()); }
@Override public CommitId readFrom(StreamInput in) throws IOException { return new CommitId(in); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); commitId = new Engine.CommitId(in); if (includeNumDocs(in.getVersion())) { numDocs = in.readInt(); } else { numDocs = UNKNOWN_NUM_DOCS; } if (includeExistingSyncId(in.getVersion())) { existingSyncId = in.readOptionalString(); } }
@Override public CommitId flush(boolean force, boolean waitIfOngoing) throws EngineException { return new CommitId(lastCommittedSegmentInfos.getId()); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardId = ShardId.readShardId(in); expectedCommitId = new Engine.CommitId(in); syncId = in.readString(); }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); shardId.writeTo(out); expectedCommitId.writeTo(out); out.writeString(syncId); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); shardId = ShardId.readShardId(in); expectedCommitId = new Engine.CommitId(in); syncId = in.readString(); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); commitId = new Engine.CommitId(in); }