Class RemoteLogSegmentMetadata
java.lang.Object
org.apache.kafka.server.log.remote.storage.RemoteLogMetadata
org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadata
It describes the metadata about a topic partition's remote log segment in the remote storage. This is uniquely
 represented with 
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.
- 
Constructor SummaryConstructorsConstructorDescriptionRemoteLogSegmentMetadata(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 asRemoteLogSegmentState.COPY_SEGMENT_STARTED.RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId, long startOffset, long endOffset, long maxTimestampMs, int brokerId, long eventTimestampMs, int segmentSizeInBytes, RemoteLogSegmentState state, Map<Integer, Long> segmentLeaderEpochs) Creates an instance with the given metadata of remote log segment.
- 
Method SummaryModifier and TypeMethodDescriptioncreateWithUpdates(RemoteLogSegmentMetadataUpdate rlsmUpdate) Creates a new RemoteLogSegmentMetadata applying the givenrlsmUpdateon this instance.longbooleaninthashCode()longintlongstate()Returns the current state of this remote log segment.toString()Methods inherited from class org.apache.kafka.server.log.remote.storage.RemoteLogMetadatabrokerId, eventTimestampMs
- 
Constructor Details- 
RemoteLogSegmentMetadatapublic RemoteLogSegmentMetadata(RemoteLogSegmentId remoteLogSegmentId, long startOffset, long endOffset, long maxTimestampMs, int brokerId, long eventTimestampMs, int segmentSizeInBytes, RemoteLogSegmentState state, Map<Integer, Long> segmentLeaderEpochs) Creates an instance with the given metadata of remote log segment.segmentLeaderEpochscan 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.- Parameters:
- 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.
- state- State of the respective segment of remoteLogSegmentId.
- segmentLeaderEpochs- leader epochs occurred within this segment.
 
- 
RemoteLogSegmentMetadatapublic 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 asRemoteLogSegmentState.COPY_SEGMENT_STARTED.segmentLeaderEpochscan 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.- Parameters:
- 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 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.
- segmentLeaderEpochs- leader epochs occurred within this segment
 
 
- 
- 
Method Details- 
remoteLogSegmentId- Returns:
- unique id of this segment.
 
- 
startOffsetpublic long startOffset()- Returns:
- Start offset of this segment (inclusive).
 
- 
endOffsetpublic long endOffset()- Returns:
- End offset of this segment (inclusive).
 
- 
segmentSizeInBytespublic int segmentSizeInBytes()- Returns:
- Total size of this segment in bytes.
 
- 
maxTimestampMspublic long maxTimestampMs()- Returns:
- Maximum timestamp in milli seconds of a record within this segment.
 
- 
segmentLeaderEpochs- Returns:
- Map of leader epoch vs offset for the records available in this segment.
 
- 
stateReturns the current state of this remote log segment. It can be any of the below
- 
createWithUpdatesCreates a new RemoteLogSegmentMetadata applying the givenrlsmUpdateon this instance. This method will not update this instance.- Parameters:
- rlsmUpdate- update to be applied.
- Returns:
- a new instance created by applying the given update on this instance.
 
- 
topicIdPartition- Specified by:
- topicIdPartitionin class- RemoteLogMetadata
- Returns:
- TopicIdPartition for which this event is generated.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-