Class SegmentInfo


  • @Beta
    public class SegmentInfo
    extends java.lang.Object
    Information about a segment of a stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      SegmentInfo​(Segment segment, long startingOffset, long writeOffset, boolean isSealed, long lastModifiedTime)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      long getLastModifiedTime()
      The last time the segment was written to.
      Segment getSegment()
      Which segment these properties relate to.
      long getStartingOffset()
      The offset at which data is available.
      long getWriteOffset()
      The offset at which new data would be written if it were to be added.
      int hashCode()  
      boolean isSealed()
      If the segment is sealed and can no longer be written to.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SegmentInfo

        @ConstructorProperties({"segment","startingOffset","writeOffset","isSealed","lastModifiedTime"})
        public SegmentInfo​(Segment segment,
                           long startingOffset,
                           long writeOffset,
                           boolean isSealed,
                           long lastModifiedTime)
    • Method Detail

      • getSegment

        public Segment getSegment()
        Which segment these properties relate to.
      • getStartingOffset

        public long getStartingOffset()
        The offset at which data is available. In the event the stream has never been truncated this is 0. However, if all data below a certain offset has been truncated, that offset will be provide here. (Offsets are left absolute even if data is truncated so that positions in the segment can be referred to consistently)
      • getWriteOffset

        public long getWriteOffset()
        The offset at which new data would be written if it were to be added. This is equal to the total length of all data written to the segment.
      • isSealed

        public boolean isSealed()
        If the segment is sealed and can no longer be written to.
      • getLastModifiedTime

        public long getLastModifiedTime()
        The last time the segment was written to.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object