/** * Adds a new range tombstone. * * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), * but it doesn't assume it. */ public void add(Composite start, Composite end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if (c < 0) { addInternal(size, start, end, markedAt, delTime); } else { // Note: insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays.binarySearch(ends, 0, size, start, comparator); insertFrom((pos >= 0 ? pos : -pos-1), start, end, markedAt, delTime); } boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize(); }
addInternal(i, starts[i], start, markedAts[i], delTimes[i]); i++; setInternal(i, start, end, markedAt, delTime); else addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, end, markedAt, delTime); i++; setInternal(i, end, ends[i], markedAts[i], delTimes[i]); addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, starts[i], markedAt, delTime); i++; addInternal(i, start, end, markedAt, delTime);
/** * Adds a new range tombstone. * * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), * but it doesn't assume it. */ public void add(ClusteringBound start, ClusteringBound end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if (c <= 0) { addInternal(size, start, end, markedAt, delTime); } else { // Note: insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays.binarySearch(ends, 0, size, start, comparator); insertFrom((pos >= 0 ? pos+1 : -pos-1), start, end, markedAt, delTime); } boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize(); }
/** * Adds a new range tombstone. * * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), * but it doesn't assume it. */ public void add(ClusteringBound start, ClusteringBound end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if (c <= 0) { addInternal(size, start, end, markedAt, delTime); } else { // Note: insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays.binarySearch(ends, 0, size, start, comparator); insertFrom((pos >= 0 ? pos+1 : -pos-1), start, end, markedAt, delTime); } boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize(); }
/** * Adds a new range tombstone. * * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), * but it doesn't assume it. */ public void add(ClusteringBound start, ClusteringBound end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if (c <= 0) { addInternal(size, start, end, markedAt, delTime); } else { // Note: insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays.binarySearch(ends, 0, size, start, comparator); insertFrom((pos >= 0 ? pos+1 : -pos-1), start, end, markedAt, delTime); } boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize(); }
/** * Adds a new range tombstone. * * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), * but it doesn't assume it. */ public void add(ClusteringBound start, ClusteringBound end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if (c <= 0) { addInternal(size, start, end, markedAt, delTime); } else { // Note: insertFrom expect i to be the insertion point in term of interval ends int pos = Arrays.binarySearch(ends, 0, size, start, comparator); insertFrom((pos >= 0 ? pos+1 : -pos-1), start, end, markedAt, delTime); } boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize(); }
addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
if (!Slice.isEmpty(comparator, starts[i], newEnd)) addInternal(i, starts[i], newEnd, markedAts[i], delTimes[i]); i++; setInternal(i, start, ends[i], markedAts[i], delTimes[i]); addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, end, markedAt, delTime); i++; ClusteringBound newStart = end.invert(); addInternal(i, start, end, markedAt, delTime); return; if (!Slice.isEmpty(comparator, start, newEnd)) addInternal(i, start, newEnd, markedAt, delTime); i++; addInternal(i, start, end, markedAt, delTime);
if (!Slice.isEmpty(comparator, starts[i], newEnd)) addInternal(i, starts[i], newEnd, markedAts[i], delTimes[i]); i++; setInternal(i, start, ends[i], markedAts[i], delTimes[i]); addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, end, markedAt, delTime); i++; ClusteringBound newStart = end.invert(); addInternal(i, start, end, markedAt, delTime); return; if (!Slice.isEmpty(comparator, start, newEnd)) addInternal(i, start, newEnd, markedAt, delTime); i++; addInternal(i, start, end, markedAt, delTime);
if (!Slice.isEmpty(comparator, starts[i], newEnd)) addInternal(i, starts[i], newEnd, markedAts[i], delTimes[i]); i++; setInternal(i, start, ends[i], markedAts[i], delTimes[i]); addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, end, markedAt, delTime); i++; ClusteringBound newStart = end.invert(); addInternal(i, start, end, markedAt, delTime); return; if (!Slice.isEmpty(comparator, start, newEnd)) addInternal(i, start, newEnd, markedAt, delTime); i++; addInternal(i, start, end, markedAt, delTime);
if (!Slice.isEmpty(comparator, starts[i], newEnd)) addInternal(i, starts[i], newEnd, markedAts[i], delTimes[i]); i++; setInternal(i, start, ends[i], markedAts[i], delTimes[i]); addInternal(i, start, end, markedAt, delTime); return; addInternal(i, start, end, markedAt, delTime); i++; ClusteringBound newStart = end.invert(); addInternal(i, start, end, markedAt, delTime); return; if (!Slice.isEmpty(comparator, start, newEnd)) addInternal(i, start, newEnd, markedAt, delTime); i++; addInternal(i, start, end, markedAt, delTime);
addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);