private void putTombstone(BytesRef uid, DeleteVersionValue version) { long uidRAMBytesUsed = BASE_BYTES_PER_BYTESREF + uid.bytes.length; // Also enroll the delete into tombstones, and account for its RAM too: final VersionValue prevTombstone = tombstones.put(uid, version); long accountRam = (BASE_BYTES_PER_CHM_ENTRY + version.ramBytesUsed() + uidRAMBytesUsed); // Deduct tombstones bytes used for the version we just removed or replaced: if (prevTombstone != null) { accountRam -= (BASE_BYTES_PER_CHM_ENTRY + prevTombstone.ramBytesUsed() + uidRAMBytesUsed); } if (accountRam != 0) { long v = ramBytesUsedTombstones.addAndGet(accountRam); assert v >= 0: "bytes=" + v; } }
@Override public String toString() { return "DeleteVersionValue{" + "version=" + getVersion() + ",time=" + time + '}'; } }
numDocDeletes.inc(); versionMap.putDeleteUnderLock(delete.uid().bytes(), new DeleteVersionValue(plan.versionOfDeletion, plan.seqNoOfDeletion, delete.primaryTerm(), engineConfig.getThreadPool().relativeTimeInMillis()));
private DeleteResult deleteInLucene(Delete delete, DeletionStrategy plan) throws IOException { try { if (plan.currentlyDeleted == false) { // any exception that comes from this is a either an ACE or a fatal exception there // can't be any document failures coming from this indexWriter.deleteDocuments(delete.uid()); numDocDeletes.inc(); } versionMap.putDeleteUnderLock(delete.uid().bytes(), new DeleteVersionValue(plan.versionOfDeletion, plan.seqNoOfDeletion, delete.primaryTerm(), engineConfig.getThreadPool().relativeTimeInMillis())); return new DeleteResult( plan.versionOfDeletion, getPrimaryTerm(), plan.seqNoOfDeletion, plan.currentlyDeleted == false); } catch (Exception ex) { if (indexWriter.getTragicException() == null) { // there is no tragic event and such it must be a document level failure return new DeleteResult( ex, plan.versionOfDeletion, getPrimaryTerm(), plan.seqNoOfDeletion, plan.currentlyDeleted == false); } else { throw ex; } } }
private DeleteResult deleteInLucene(Delete delete, DeletionStrategy plan) throws IOException { try { if (plan.currentlyDeleted == false) { // any exception that comes from this is a either an ACE or a fatal exception there // can't be any document failures coming from this indexWriter.deleteDocuments(delete.uid()); } versionMap.putUnderLock(delete.uid().bytes(), new DeleteVersionValue(plan.versionOfDeletion, engineConfig.getThreadPool().relativeTimeInMillis())); return new DeleteResult(plan.versionOfDeletion, plan.currentlyDeleted == false); } catch (Exception ex) { if (indexWriter.getTragicException() == null) { // there is no tragic event and such it must be a document level failure return new DeleteResult(ex, plan.versionOfDeletion, plan.currentlyDeleted == false); } else { throw ex; } } }
private void putTombstone(BytesRef uid, DeleteVersionValue version) { long uidRAMBytesUsed = BASE_BYTES_PER_BYTESREF + uid.bytes.length; // Also enroll the delete into tombstones, and account for its RAM too: final VersionValue prevTombstone = tombstones.put(uid, version); long accountRam = (BASE_BYTES_PER_CHM_ENTRY + version.ramBytesUsed() + uidRAMBytesUsed); // Deduct tombstones bytes used for the version we just removed or replaced: if (prevTombstone != null) { accountRam -= (BASE_BYTES_PER_CHM_ENTRY + prevTombstone.ramBytesUsed() + uidRAMBytesUsed); } if (accountRam != 0) { long v = ramBytesUsedTombstones.addAndGet(accountRam); assert v >= 0: "bytes=" + v; } }
numDocDeletes.inc(); versionMap.putDeleteUnderLock(delete.uid().bytes(), new DeleteVersionValue(plan.versionOfDeletion, plan.seqNoOfDeletion, delete.primaryTerm(), engineConfig.getThreadPool().relativeTimeInMillis()));
private void putTombstone(BytesRef uid, DeleteVersionValue version) { long uidRAMBytesUsed = BASE_BYTES_PER_BYTESREF + uid.bytes.length; // Also enroll the delete into tombstones, and account for its RAM too: final VersionValue prevTombstone = tombstones.put(uid, version); long accountRam = (BASE_BYTES_PER_CHM_ENTRY + version.ramBytesUsed() + uidRAMBytesUsed); // Deduct tombstones bytes used for the version we just removed or replaced: if (prevTombstone != null) { accountRam -= (BASE_BYTES_PER_CHM_ENTRY + prevTombstone.ramBytesUsed() + uidRAMBytesUsed); } if (accountRam != 0) { long v = ramBytesUsedTombstones.addAndGet(accountRam); assert v >= 0: "bytes=" + v; } }
versionMap.putUnderLock(delete.uid().bytes(), new DeleteVersionValue(updatedVersion, engineConfig.getThreadPool() .estimatedTimeInMillis(), translogLocation)); delete.setTranslogLocation(translogLocation);