public class CommitLogSegment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CommitLogSegment.CommitLogSegmentFileComparator |
Modifier and Type | Field and Description |
---|---|
CommitLogDescriptor |
descriptor |
long |
id |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the segment file.
|
boolean |
contains(ReplayPosition context)
Check to see if a certain ReplayPosition is contained by this segment file.
|
java.lang.String |
dirtyString() |
void |
discard(boolean deleteFile)
Completely discards a segment file by deleting it.
|
static CommitLogSegment |
freshSegment() |
ReplayPosition |
getContext() |
java.util.Collection<java.util.UUID> |
getDirtyCFIDs() |
java.lang.String |
getName() |
static long |
getNextId() |
java.lang.String |
getPath() |
boolean |
hasCapacityFor(long size) |
boolean |
isUnused() |
void |
markClean(java.util.UUID cfId,
ReplayPosition context)
Marks the ColumnFamily specified by cfId as clean for this log segment.
|
int |
position() |
CommitLogSegment |
recycle()
Recycle processes an unneeded segment file for reuse.
|
void |
sync()
Forces a disk flush for this segment file.
|
java.lang.String |
toString() |
ReplayPosition |
write(RowMutation mutation)
Appends a row mutation onto the commit log.
|
public final long id
public final CommitLogDescriptor descriptor
public static CommitLogSegment freshSegment()
public static long getNextId()
public void discard(boolean deleteFile)
public CommitLogSegment recycle()
public boolean hasCapacityFor(long size)
public ReplayPosition write(RowMutation mutation) throws java.io.IOException
mutation
- the mutation to append to the commit log.java.io.IOException
public void sync()
public ReplayPosition getContext()
public java.lang.String getPath()
public java.lang.String getName()
public void close()
public void markClean(java.util.UUID cfId, ReplayPosition context)
cfId
- the column family ID that is now cleancontext
- the optional clean offsetpublic java.util.Collection<java.util.UUID> getDirtyCFIDs()
public boolean isUnused()
public boolean contains(ReplayPosition context)
context
- the replay position to be checkedpublic java.lang.String dirtyString()
public java.lang.String toString()
toString
in class java.lang.Object
public int position()
Copyright © 2014 The Apache Software Foundation