public interface TierPartitionState
Modifier and Type | Interface and Description |
---|---|
static class |
TierPartitionState.AppendResult
The result of an attempt to append a tier metadata entry.
|
Modifier and Type | Method and Description |
---|---|
TierPartitionState.AppendResult |
append(AbstractTierMetadata tierMetadata)
Appends abstract metadata to the tier partition.
|
void |
beginCatchup()
Begin catchup phase for tier partition state.
|
void |
close()
Close TierPartition, flushing to disk.
|
void |
closeHandlers() |
java.util.Optional<java.lang.Long> |
committedEndOffset()
Return the end offset spanned by the TierPartitionState that has been committed to disk.
|
void |
delete()
Delete this TierPartitionState from local storage.
|
java.io.File |
dir()
The directory where the TierPartition is stored on disk.
|
java.util.Optional<java.lang.Long> |
endOffset()
Return the uncommitted end offset spanned by the TierPartitionState.
|
void |
flush()
flush data contained in this TierPartitionState to disk.
|
java.util.concurrent.Future<TierObjectMetadata> |
materializationListener(long targetOffset)
Sets up a listener for this tier partition state for use by the replica fetcher.
|
java.util.Optional<TierObjectMetadata> |
metadata(long targetOffset)
Lookup the TierObjectMetadata which will contain data for a target offset.
|
int |
numSegments()
Scan the ObjectMetadata (segment) entries in this tier partition, and return the count.
|
void |
onCatchUpComplete()
Mark catchup completed for tier partition state.
|
void |
onTieringEnable()
Called when tiering is enabled for this tier topic partition.
|
java.lang.String |
path()
Path to where the TierPartition is stored on disk.
|
java.util.NavigableSet<java.lang.Long> |
segmentOffsets()
Get the set of base offsets for all tiered segments.
|
java.util.NavigableSet<java.lang.Long> |
segmentOffsets(long from,
long to)
Get the set of base offsets for all tiered segments in a given range.
|
java.util.Optional<java.lang.Long> |
startOffset()
Determine start offset spanned by the TierPartitionState.
|
TierPartitionStatus |
status()
Return the current status of the TierPartitionState.
|
int |
tierEpoch()
Return the current tierEpoch.
|
boolean |
tieringEnabled() |
org.apache.kafka.common.TopicPartition |
topicPartition()
The topic-partition corresponding to this TierPartition.
|
long |
totalSize()
Sum the size of all segment spanned by this TierPartitionState.
|
void |
updateDir(java.io.File dir)
Update the directory reference for the log and indices in this segment.
|
org.apache.kafka.common.TopicPartition topicPartition()
java.io.File dir()
java.lang.String path()
java.util.Optional<java.lang.Long> startOffset() throws java.io.IOException
java.io.IOException
java.util.Optional<java.lang.Long> committedEndOffset() throws java.io.IOException
java.io.IOException
java.util.Optional<java.lang.Long> endOffset() throws java.io.IOException
java.io.IOException
int numSegments()
java.util.NavigableSet<java.lang.Long> segmentOffsets()
java.util.NavigableSet<java.lang.Long> segmentOffsets(long from, long to) throws java.io.IOException
from
- Start of the range, include segment which contains "from" (inclusive)to
- End of the range, upper bound exclusive offset to include or the end of the log if "to" is past the endjava.io.IOException
java.util.Optional<TierObjectMetadata> metadata(long targetOffset) throws java.io.IOException
targetOffset
- the target offset to lookup the overlapping or next metadata for.java.io.IOException
- if disk error encounteredTierPartitionState.AppendResult append(AbstractTierMetadata tierMetadata) throws java.io.IOException
tierMetadata
- AbstractTierMetadata entry to be appended to the tier partition log.java.io.IOException
long totalSize() throws java.io.IOException
java.io.IOException
int tierEpoch() throws java.io.IOException
java.io.IOException
boolean tieringEnabled()
void onTieringEnable() throws java.io.IOException
java.io.IOException
void flush() throws java.io.IOException
java.io.IOException
void beginCatchup()
void onCatchUpComplete()
java.util.concurrent.Future<TierObjectMetadata> materializationListener(long targetOffset) throws java.io.IOException
targetOffset
- the offset awaiting materializationjava.io.IOException
TierPartitionStatus status()
void updateDir(java.io.File dir)
dir
- The new directoryvoid delete() throws java.io.IOException
java.io.IOException
void close() throws java.io.IOException
java.io.IOException
void closeHandlers() throws java.io.IOException
java.io.IOException