Class RemoteLogSegmentMetadata

java.lang.Object
org.apache.kafka.server.log.remote.storage.RemoteLogMetadata
org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadata

@Evolving public class RemoteLogSegmentMetadata extends RemoteLogMetadata
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 Details

    • RemoteLogSegmentMetadata

      public 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.

      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.

      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.
    • RemoteLogSegmentMetadata

      public 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.

      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.

      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