Class LogSegmentData

java.lang.Object
org.apache.kafka.server.log.remote.storage.LogSegmentData

@Evolving
public class LogSegmentData
extends Object
This represents all the required data and indexes for a specific log segment that needs to be stored in the remote storage. This is passed with RemoteStorageManager.copyLogSegmentData(RemoteLogSegmentMetadata, LogSegmentData) while copying a specific log segment to the remote storage.
  • Constructor Details

    • LogSegmentData

      public LogSegmentData​(Path logSegment, Path offsetIndex, Path timeIndex, Optional<Path> transactionIndex, Path producerSnapshotIndex, ByteBuffer leaderEpochIndex)
      Creates a LogSegmentData instance with data and indexes.
      Parameters:
      logSegment - actual log segment file
      offsetIndex - offset index file
      timeIndex - time index file
      transactionIndex - transaction index file, which can be null
      producerSnapshotIndex - producer snapshot until this segment
      leaderEpochIndex - leader-epoch-index until this segment
  • Method Details

    • logSegment

      public Path logSegment()
      Returns:
      Log segment file of this segment.
    • offsetIndex

      public Path offsetIndex()
      Returns:
      Offset index file.
    • timeIndex

      public Path timeIndex()
      Returns:
      Time index file of this segment.
    • transactionIndex

      public Optional<Path> transactionIndex()
      Returns:
      Transaction index file of this segment if it exists.
    • producerSnapshotIndex

      public Path producerSnapshotIndex()
      Returns:
      Producer snapshot file until this segment.
    • leaderEpochIndex

      public ByteBuffer leaderEpochIndex()
      Returns:
      Leader epoch index until this segment.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object