|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.commitlog.CommitLogAllocator
public class CommitLogAllocator
Performs the pre-allocation of commit log segments in a background thread. All the public methods are thread safe.
Field Summary | |
---|---|
static int |
TICK_CYCLE_TIME
The (theoretical) max milliseconds between loop runs to perform janitorial tasks |
Constructor Summary | |
---|---|
CommitLogAllocator()
|
Method Summary | |
---|---|
void |
awaitTermination()
Returns when the allocator thread terminates. |
long |
bytesUsed()
|
void |
enableReserveSegmentCreation()
Throws a flag that enables the behavior of keeping at least one spare segment available at all times. |
CommitLogSegment |
fetchSegment()
Fetches an empty segment file. |
java.util.Collection<CommitLogSegment> |
getActiveSegments()
|
boolean |
manages(java.lang.String name)
|
void |
recycleSegment(CommitLogSegment segment)
Indicates that a segment is no longer in use and that it should be recycled. |
void |
recycleSegment(java.io.File file)
Differs from the above because it can work on any file instead of just existing commit log segments managed by this allocator. |
void |
resetUnsafe()
Resets all the segments, for testing purposes. |
void |
shutdown()
Initiates the shutdown process for the allocator thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TICK_CYCLE_TIME
Constructor Detail |
---|
public CommitLogAllocator()
Method Detail |
---|
public CommitLogSegment fetchSegment()
public void recycleSegment(CommitLogSegment segment)
segment
- segment that is no longer in usepublic void recycleSegment(java.io.File file)
file
- segment file that is no longer in use.public long bytesUsed()
public boolean manages(java.lang.String name)
name
- the filename to check
public void enableReserveSegmentCreation()
public void resetUnsafe()
public void shutdown()
public void awaitTermination() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.util.Collection<CommitLogSegment> getActiveSegments()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |