public abstract class CommitLogSegment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
CommitLogSegment.Allocation
A simple class for tracking information about the portion of a segment that has been allocated to a log write.
|
static class |
CommitLogSegment.CDCState |
static class |
CommitLogSegment.CommitLogSegmentFileComparator |
Modifier and Type | Field and Description |
---|---|
CommitLogDescriptor |
descriptor |
static int |
ENTRY_OVERHEAD_SIZE |
long |
id |
protected AbstractCommitLogSegmentManager |
manager |
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(CommitLogPosition context)
Check to see if a certain CommitLogPosition is contained by this segment file.
|
long |
contentSize() |
static <K> void |
coverInMap(java.util.concurrent.ConcurrentMap<K,IntegerInterval> map,
K key,
int value) |
java.lang.String |
dirtyString() |
java.io.File |
getCDCFile() |
java.io.File |
getCDCIndexFile() |
CommitLogSegment.CDCState |
getCDCState() |
CommitLogPosition |
getCurrentCommitLogPosition() |
java.util.Collection<TableId> |
getDirtyTableIds() |
java.lang.String |
getName() |
java.lang.String |
getPath() |
protected void |
internalClose()
Close the segment file.
|
boolean |
isStillAllocating() |
boolean |
isUnused() |
void |
markClean(TableId tableId,
CommitLogPosition startPosition,
CommitLogPosition endPosition)
Marks the ColumnFamily specified by id as clean for this log segment.
|
abstract long |
onDiskSize() |
void |
setCDCState(CommitLogSegment.CDCState newState)
Change the current cdcState on this CommitLogSegment.
|
java.lang.String |
toString() |
static void |
writeCDCIndexFile(CommitLogDescriptor desc,
int offset,
boolean complete)
We persist the offset of the last data synced to disk so clients can parse only durable data if they choose.
|
protected static void |
writeSyncMarker(long id,
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
protected final AbstractCommitLogSegmentManager manager
public final CommitLogDescriptor descriptor
protected java.util.Map<java.lang.String,java.lang.String> additionalHeaderParameters()
CommitLogDescriptor
.public static void writeCDCIndexFile(CommitLogDescriptor desc, int offset, boolean complete)
protected static void writeSyncMarker(long id, 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 CommitLogPosition getCurrentCommitLogPosition()
public java.lang.String getPath()
public java.lang.String getName()
public java.io.File getCDCFile()
public java.io.File getCDCIndexFile()
protected void internalClose()
public static <K> void coverInMap(java.util.concurrent.ConcurrentMap<K,IntegerInterval> map, K key, int value)
public void markClean(TableId tableId, CommitLogPosition startPosition, CommitLogPosition endPosition)
tableId
- the table that is now cleanstartPosition
- the start of the range that is cleanendPosition
- the end of the range that is cleanpublic java.util.Collection<TableId> getDirtyTableIds()
public boolean isUnused()
public boolean contains(CommitLogPosition context)
context
- the commit log segment 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
public CommitLogSegment.CDCState getCDCState()
public void setCDCState(CommitLogSegment.CDCState newState)
Copyright © 2009-2021 The Apache Software Foundation