private void markClean(UUID cfId, int position) { ensureAtleast(cfClean, cfId, position); removeCleanFromDirty(); }
/** * @return true if this segment is unused and safe to recycle or delete */ public synchronized boolean isUnused() { // if room to allocate, we're still in use as the active allocatingFrom, // so we don't want to race with updates to cfClean with removeCleanFromDirty if (isStillAllocating()) return false; removeCleanFromDirty(); return cfDirty.isEmpty(); }
/** * @return true if this segment is unused and safe to recycle or delete */ public synchronized boolean isUnused() { // if room to allocate, we're still in use as the active allocatingFrom, // so we don't want to race with updates to cfClean with removeCleanFromDirty if (isStillAllocating()) return false; removeCleanFromDirty(); return cfDirty.isEmpty(); }
/** * @return true if this segment is unused and safe to recycle or delete */ public synchronized boolean isUnused() { // if room to allocate, we're still in use as the active allocatingFrom, // so we don't want to race with updates to cfClean with removeCleanFromDirty if (isStillAllocating()) return false; removeCleanFromDirty(); return cfDirty.isEmpty(); }
/** * @return true if this segment is unused and safe to recycle or delete */ public synchronized boolean isUnused() { // if room to allocate, we're still in use as the active allocatingFrom, // so we don't want to race with updates to cfClean with removeCleanFromDirty if (isStillAllocating()) return false; removeCleanFromDirty(); return cfDirty.isEmpty(); }
/** * Marks the ColumnFamily specified by cfId as clean for this log segment. If the * given context argument is contained in this file, it will only mark the CF as * clean if no newer writes have taken place. * * @param cfId the column family ID that is now clean * @param startPosition the start of the range that is clean * @param endPosition the end of the range that is clean */ public synchronized void markClean(UUID cfId, CommitLogPosition startPosition, CommitLogPosition endPosition) { if (startPosition.segmentId > id || endPosition.segmentId < id) return; if (!cfDirty.containsKey(cfId)) return; int start = startPosition.segmentId == id ? startPosition.position : 0; int end = endPosition.segmentId == id ? endPosition.position : Integer.MAX_VALUE; cfClean.computeIfAbsent(cfId, k -> new IntegerInterval.Set()).add(start, end); removeCleanFromDirty(); }
/** * Marks the ColumnFamily specified by cfId as clean for this log segment. If the * given context argument is contained in this file, it will only mark the CF as * clean if no newer writes have taken place. * * @param cfId the column family ID that is now clean * @param startPosition the start of the range that is clean * @param endPosition the end of the range that is clean */ public synchronized void markClean(UUID cfId, CommitLogPosition startPosition, CommitLogPosition endPosition) { if (startPosition.segmentId > id || endPosition.segmentId < id) return; if (!cfDirty.containsKey(cfId)) return; int start = startPosition.segmentId == id ? startPosition.position : 0; int end = endPosition.segmentId == id ? endPosition.position : Integer.MAX_VALUE; cfClean.computeIfAbsent(cfId, k -> new IntegerInterval.Set()).add(start, end); removeCleanFromDirty(); }
/** * Marks the ColumnFamily specified by cfId as clean for this log segment. If the * given context argument is contained in this file, it will only mark the CF as * clean if no newer writes have taken place. * * @param cfId the column family ID that is now clean * @param startPosition the start of the range that is clean * @param endPosition the end of the range that is clean */ public synchronized void markClean(UUID cfId, CommitLogPosition startPosition, CommitLogPosition endPosition) { if (startPosition.segmentId > id || endPosition.segmentId < id) return; if (!cfDirty.containsKey(cfId)) return; int start = startPosition.segmentId == id ? startPosition.position : 0; int end = endPosition.segmentId == id ? endPosition.position : Integer.MAX_VALUE; cfClean.computeIfAbsent(cfId, k -> new IntegerInterval.Set()).add(start, end); removeCleanFromDirty(); }