Record Class LinearDataSlice.Gap<T>

java.lang.Object
java.lang.Record
velox.api.layer1.dynamichistory.LinearDataSlice.Gap<T>
Record Components:
firstIndex - absolute index of the first missing block
lastIndex - absolute index of the last missing block (inclusive)
startTimeNanos - inclusive start of the missing period (epoch nanos)
endTimeNanos - exclusive end of the missing period (epoch nanos)
All Implemented Interfaces:
LinearDataSlice.Entry<T>
Enclosing class:
LinearDataSlice<T>

public static record LinearDataSlice.Gap<T>(long firstIndex, long lastIndex, long startTimeNanos, long endTimeNanos) extends Record implements LinearDataSlice.Entry<T>
A run of consecutive blocks the server does not have. Its time span is exact: it starts where the preceding block ends and ends where the following block starts.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Gap(long firstIndex, long lastIndex, long startTimeNanos, long endTimeNanos)
    Creates an instance of a Gap record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Number of blocks missing.
    long
    Returns the value of the endTimeNanos record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the firstIndex record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the lastIndex record component.
    long
    Returns the value of the startTimeNanos record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Gap

      public Gap(long firstIndex, long lastIndex, long startTimeNanos, long endTimeNanos)
      Creates an instance of a Gap record class.
      Parameters:
      firstIndex - the value for the firstIndex record component
      lastIndex - the value for the lastIndex record component
      startTimeNanos - the value for the startTimeNanos record component
      endTimeNanos - the value for the endTimeNanos record component
  • Method Details

    • blockCount

      public long blockCount()
      Number of blocks missing.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • firstIndex

      public long firstIndex()
      Returns the value of the firstIndex record component.
      Specified by:
      firstIndex in interface LinearDataSlice.Entry<T>
      Returns:
      the value of the firstIndex record component
    • lastIndex

      public long lastIndex()
      Returns the value of the lastIndex record component.
      Specified by:
      lastIndex in interface LinearDataSlice.Entry<T>
      Returns:
      the value of the lastIndex record component
    • startTimeNanos

      public long startTimeNanos()
      Returns the value of the startTimeNanos record component.
      Specified by:
      startTimeNanos in interface LinearDataSlice.Entry<T>
      Returns:
      the value of the startTimeNanos record component
    • endTimeNanos

      public long endTimeNanos()
      Returns the value of the endTimeNanos record component.
      Specified by:
      endTimeNanos in interface LinearDataSlice.Entry<T>
      Returns:
      the value of the endTimeNanos record component