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,
long tierTopicPartitionOffset)
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() |
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.
|
void |
enableTierConfig()
Called when tiering is enabled for this tier topic partition.
|
long |
endOffset()
Return the uncommitted end offset spanned by the TierPartitionState.
|
java.util.Collection<TierObjectMetadata> |
fencedSegments() |
void |
flush()
flush data contained in this TierPartitionState to disk.
|
boolean |
isTieringEnabled() |
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.
|
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.
|
boolean |
setTopicId(java.util.UUID topicId)
Sets the TopicIdPartition for this TierPartitionState.
|
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.
|
java.util.Optional<TopicIdPartition> |
topicIdPartition()
Optional TopicIdPartition corresponding to this TierPartition
If one has not been set, returns empty
|
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.util.Optional<TopicIdPartition> topicIdPartition()
java.io.File dir()
java.util.Optional<java.lang.Long> startOffset() throws java.io.IOException
java.io.IOException
boolean setTopicId(java.util.UUID topicId) throws java.io.IOException
topicId
- The topic id to assignjava.io.IOException
java.lang.IllegalStateException
- on topic id mismatch, if it had already been set beforelong committedEndOffset() throws java.io.IOException
java.io.IOException
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 encounteredjava.util.Collection<TierObjectMetadata> fencedSegments()
TierPartitionState.AppendResult append(AbstractTierMetadata tierMetadata, long tierTopicPartitionOffset) throws java.io.IOException
tierMetadata
- AbstractTierMetadata entry to be appended to the tier partition log.tierTopicPartitionOffset
- offset of the Tier Topic Partition containing the tierMetadata.java.io.IOException
long totalSize() throws java.io.IOException
java.io.IOException
int tierEpoch() throws java.io.IOException
java.io.IOException
boolean isTieringEnabled()
void enableTierConfig() 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