Class CommitLogSegmentManagerCDC
- java.lang.Object
-
- org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager
-
- org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDC
-
public class CommitLogSegmentManagerCDC extends AbstractCommitLogSegmentManager
-
-
Constructor Summary
Constructors Constructor Description CommitLogSegmentManagerCDC(CommitLog commitLog, java.lang.String storageDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCDCSize(long size)
For use after replay when replayer hard-links / adds tracking of replayed segmentsCommitLogSegment.Allocation
allocate(Mutation mutation, int size)
Reserve space in the current segment for the provided mutation or, if there isn't space available, create a new segment.CommitLogSegment
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 thislong
deleteOldLinkedCDCCommitLogSegment(long bytesToFree)
Delete the oldest hard-linked CDC commit log segment to free up space.void
discard(CommitLogSegment segment, boolean delete)
void
shutdown()
Initiates the shutdown process for the management thread.long
updateCDCTotalSize()
Only 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 Detail
-
CommitLogSegmentManagerCDC
public CommitLogSegmentManagerCDC(CommitLog commitLog, java.lang.String storageDirectory)
-
-
Method Detail
-
discard
public void discard(CommitLogSegment segment, boolean delete)
-
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:
shutdown
in classAbstractCommitLogSegmentManager
-
allocate
public CommitLogSegment.Allocation allocate(Mutation mutation, int size) throws CDCWriteException
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:
allocate
in 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
public CommitLogSegment 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:
createSegment
in 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.
-
-