Class CommitLogSegmentManagerCDC

java.lang.Object
org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager
org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDC

public class CommitLogSegmentManagerCDC extends AbstractCommitLogSegmentManager
  • Constructor Details

    • CommitLogSegmentManagerCDC

      public CommitLogSegmentManagerCDC(CommitLog commitLog, String storageDirectory)
  • Method Details

    • 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 class AbstractCommitLogSegmentManager
    • 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 class AbstractCommitLogSegmentManager
      Parameters:
      mutation - Mutation to allocate in segment manager
      size - 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 class AbstractCommitLogSegmentManager
    • 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.