Class CommitLogSegmentManagerCDC
java.lang.Object
org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager
org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCDCSize(long size) For use after replay when replayer hard-links / adds tracking of replayed segmentsReserve space in the current segment for the provided mutation or, if there isn't space available, create a new segment.On segment creation, flag whether the segment should accept CDC mutations or not based on the total currently allocated unflushed CDC segments and the contents of cdc_raw Synchronized on thislongdeleteOldLinkedCDCCommitLogSegment(long bytesToFree) Delete the oldest hard-linked CDC commit log segment to free up space.voiddiscard(CommitLogSegment segment, boolean delete) voidshutdown()Initiates the shutdown process for the management thread.longOnly use for testing / validation that size tracker is working.Methods inherited from class org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager
awaitManagementTasksCompletion, awaitTermination, getActiveSegments, onDiskSize, stopUnsafe, sync
-
Constructor Details
-
CommitLogSegmentManagerCDC
-
-
Method Details
-
discard
-
deleteOldLinkedCDCCommitLogSegment
public long deleteOldLinkedCDCCommitLogSegment(long bytesToFree) Delete the oldest hard-linked CDC commit log segment to free up space.- Parameters:
bytesToFree- the minimum space to free up- Returns:
- total size under the CDC folder in bytes after deletion
-
shutdown
public void shutdown()Initiates the shutdown process for the management thread. Also stops the cdc on-disk size calculator executor.- Overrides:
shutdownin classAbstractCommitLogSegmentManager
-
allocate
Reserve space in the current segment for the provided mutation or, if there isn't space available, create a new segment. For CDC mutations, allocation is expected to throw WTE if the segment disallows CDC mutations.- Specified by:
allocatein classAbstractCommitLogSegmentManager- Parameters:
mutation- Mutation to allocate in segment managersize- total size (overhead + serialized) of mutation- Returns:
- the created Allocation object
- Throws:
CDCWriteException- If segment disallows CDC mutations, we throw
-
createSegment
On segment creation, flag whether the segment should accept CDC mutations or not based on the total currently allocated unflushed CDC segments and the contents of cdc_raw Synchronized on this- Overrides:
createSegmentin classAbstractCommitLogSegmentManager
-
addCDCSize
public void addCDCSize(long size) For use after replay when replayer hard-links / adds tracking of replayed segments -
updateCDCTotalSize
public long updateCDCTotalSize()Only use for testing / validation that size tracker is working. Not for production use.
-