public abstract class CommitLogSegment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CommitLogSegment.CommitLogSegmentFileComparator |
Modifier and Type | Field and Description |
---|---|
CommitLogDescriptor |
descriptor |
static int |
ENTRY_OVERHEAD_SIZE |
long |
id |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
additionalHeaderParameters()
Provide any additional header data that should be stored in the
CommitLogDescriptor . |
boolean |
contains(ReplayPosition context)
Check to see if a certain ReplayPosition is contained by this segment file.
|
long |
contentSize() |
java.lang.String |
dirtyString() |
ReplayPosition |
getContext() |
java.util.Collection<java.util.UUID> |
getDirtyCFIDs() |
java.lang.String |
getName() |
java.lang.String |
getPath() |
protected void |
internalClose()
Close the segment file.
|
boolean |
isStillAllocating() |
boolean |
isUnused() |
void |
markClean(java.util.UUID cfId,
ReplayPosition context)
Marks the ColumnFamily specified by cfId as clean for this log segment.
|
abstract long |
onDiskSize() |
java.lang.String |
toString() |
protected void |
writeSyncMarker(java.nio.ByteBuffer buffer,
int offset,
int filePos,
int nextMarker)
Create a sync marker to delineate sections of the commit log, typically created on each sync of the file.
|
public static final int ENTRY_OVERHEAD_SIZE
public final long id
public final CommitLogDescriptor descriptor
protected java.util.Map<java.lang.String,java.lang.String> additionalHeaderParameters()
CommitLogDescriptor
.protected void writeSyncMarker(java.nio.ByteBuffer buffer, int offset, int filePos, int nextMarker)
buffer
- buffer in which to write out the sync marker.offset
- Offset into the buffer
at which to write the sync marker.filePos
- The current position in the target file where the sync marker will be written (most likely different from the buffer position).nextMarker
- The file position of where the next sync marker should be.public boolean isStillAllocating()
public ReplayPosition getContext()
public java.lang.String getPath()
public java.lang.String getName()
protected void internalClose()
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 abstract long onDiskSize()
public long contentSize()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2016 The Apache Software Foundation