@InterfaceStability.Evolving public class RemoteLogSegmentMetadata extends RemoteLogMetadata
RemoteLogSegmentId.
New instance is always created with the state as RemoteLogSegmentState.COPY_SEGMENT_STARTED. This can be
updated by applying RemoteLogSegmentMetadataUpdate for the respective RemoteLogSegmentId of the
RemoteLogSegmentMetadata.
| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteLogSegmentMetadata.CustomMetadata
Custom metadata from a
RemoteStorageManager plugin. |
| Constructor and Description |
|---|
RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId,
long startOffset,
long endOffset,
long maxTimestampMs,
int brokerId,
long eventTimestampMs,
int segmentSizeInBytes,
Map<Integer,Long> segmentLeaderEpochs)
Creates an instance with the given metadata of remote log segment and its state as
RemoteLogSegmentState.COPY_SEGMENT_STARTED. |
RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId,
long startOffset,
long endOffset,
long maxTimestampMs,
int brokerId,
long eventTimestampMs,
int segmentSizeInBytes,
Optional<RemoteLogSegmentMetadata.CustomMetadata> customMetadata,
RemoteLogSegmentState state,
Map<Integer,Long> segmentLeaderEpochs)
Creates an instance with the given metadata of remote log segment.
|
| Modifier and Type | Method and Description |
|---|---|
RemoteLogSegmentMetadata |
createWithUpdates(RemoteLogSegmentMetadataUpdate rlsmUpdate)
Creates a new RemoteLogSegmentMetadata applying the given
rlsmUpdate on this instance. |
Optional<RemoteLogSegmentMetadata.CustomMetadata> |
customMetadata() |
long |
endOffset() |
boolean |
equals(Object o) |
int |
hashCode() |
long |
maxTimestampMs() |
RemoteLogSegmentId |
remoteLogSegmentId() |
NavigableMap<Integer,Long> |
segmentLeaderEpochs() |
int |
segmentSizeInBytes() |
long |
startOffset() |
RemoteLogSegmentState |
state()
Returns the current state of this remote log segment.
|
TopicIdPartition |
topicIdPartition() |
String |
toString() |
brokerId, eventTimestampMspublic RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId, long startOffset, long endOffset, long maxTimestampMs, int brokerId, long eventTimestampMs, int segmentSizeInBytes, Optional<RemoteLogSegmentMetadata.CustomMetadata> customMetadata, RemoteLogSegmentState state, Map<Integer,Long> segmentLeaderEpochs)
segmentLeaderEpochs can not be empty. If all the records in this segment belong to the same leader epoch
then it should have an entry with epoch mapping to start-offset of this segment.
remoteLogSegmentId - Universally unique remote log segment id.startOffset - Start offset of this segment (inclusive).endOffset - End offset of this segment (inclusive).maxTimestampMs - Maximum timestamp in milli seconds in this segment.brokerId - Broker id from which this event is generated.eventTimestampMs - Epoch time in milli seconds at which the remote log segment is copied to the remote tier storage.segmentSizeInBytes - Size of this segment in bytes.customMetadata - Custom metadata.state - State of the respective segment of remoteLogSegmentId.segmentLeaderEpochs - leader epochs occurred within this segment.public RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId, long startOffset, long endOffset, long maxTimestampMs, int brokerId, long eventTimestampMs, int segmentSizeInBytes, Map<Integer,Long> segmentLeaderEpochs)
RemoteLogSegmentState.COPY_SEGMENT_STARTED.
segmentLeaderEpochs can not be empty. If all the records in this segment belong to the same leader epoch
then it should have an entry with epoch mapping to start-offset of this segment.
remoteLogSegmentId - Universally unique remote log segment id.startOffset - Start offset of this segment (inclusive).endOffset - End offset of this segment (inclusive).maxTimestampMs - Maximum timestamp in this segmentbrokerId - Broker id from which this event is generated.eventTimestampMs - Epoch time in milli seconds at which the remote log segment is copied to the remote tier storage.segmentSizeInBytes - Size of this segment in bytes.segmentLeaderEpochs - leader epochs occurred within this segmentpublic RemoteLogSegmentId remoteLogSegmentId()
public long startOffset()
public long endOffset()
public int segmentSizeInBytes()
public long maxTimestampMs()
public NavigableMap<Integer,Long> segmentLeaderEpochs()
public Optional<RemoteLogSegmentMetadata.CustomMetadata> customMetadata()
public RemoteLogSegmentState state()
public RemoteLogSegmentMetadata createWithUpdates(RemoteLogSegmentMetadataUpdate rlsmUpdate)
rlsmUpdate on this instance. This method will
not update this instance.rlsmUpdate - update to be applied.public TopicIdPartition topicIdPartition()
topicIdPartition in class RemoteLogMetadata