org.apache.cassandra.db.commitlog

## Class CommitLogSegmentManagerStandard

- java.lang.Object
- - org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager
  - - org.apache.cassandra.db.commitlog.CommitLogSegmentManagerStandard

-     public class CommitLogSegmentManagerStandard
      extends AbstractCommitLogSegmentManager

- - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager

      `commitLog`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommitLogSegmentManagerStandard(CommitLog commitLog, java.lang.String storageDirectory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CommitLogSegment.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()` Hook to allow segment managers to track state surrounding creation of new segments.
    `void` | `discard(CommitLogSegment segment, boolean delete)` Indicates that a segment file has been flushed and is no longer needed.

    - ### Methods inherited from class org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager

      `awaitTermination, getActiveSegments, onDiskSize, shutdown, stopUnsafe, sync`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CommitLogSegmentManagerStandard

          public CommitLogSegmentManagerStandard(CommitLog commitLog,
                                                 java.lang.String storageDirectory)

  - ### Method Detail

    - #### discard

          public void discard(CommitLogSegment segment,
                              boolean delete)

      Description copied from class: `AbstractCommitLogSegmentManager`
      Indicates that a segment file has been flushed and is no longer needed. Only perform as task submit to segment manager so it's performend on segment management thread, or perform while segment management thread is shutdown during testing resets.
      Parameters:
        `segment` - segment to be discarded
        `delete` - whether or not the segment is safe to be deleted.

    - #### allocate

          public CommitLogSegment.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. allocate() is blocking until allocation succeeds as it waits on a signal in advanceAllocatingFrom
      Specified by:
        `allocate` in class `AbstractCommitLogSegmentManager`
      Parameters:
        `mutation` - mutation to allocate space for
        `size` - total size of mutation (overhead + serialized size)
      Returns:
        the provided Allocation object

    - #### createSegment

          public CommitLogSegment createSegment()

      Description copied from class: `AbstractCommitLogSegmentManager`
      Hook to allow segment managers to track state surrounding creation of new segments. Onl perform as task submit to segment manager so it's performed on segment management thread.

Copyright © 2018 The Apache Software Foundation