Class Lsn

java.lang.Object
io.debezium.connector.informix.Lsn
All Implemented Interfaces:
io.debezium.connector.Nullable, Comparable<Lsn>

public class Lsn extends Object implements Comparable<Lsn>, io.debezium.connector.Nullable
A logical representation of LSN (log sequence number) position. When LSN is not available it is replaced with NULL constant.
Author:
Laoflch Luo, Xiaolin Zhang, Lars M Johansson
  • Field Details

    • NULL

      public static final Lsn NULL
    • LO_MASK

      private static final long LO_MASK
    • HI_MASK

      private static final long HI_MASK
    • lsn

      private final Long lsn
  • Constructor Details

    • Lsn

      Lsn(Long lsn)
  • Method Details

    • valueOf

      public static Lsn valueOf(String lsn)
      Parameters:
      lsn - - signed long integer string. We consider "NULL" and "-1L" as same as "new Lsn(-1)".
      Returns:
      LSN converted from its textual representation
    • valueOf

      public static Lsn valueOf(Long lsn)
    • isAvailable

      public boolean isAvailable()
      Specified by:
      isAvailable in interface io.debezium.connector.Nullable
      Returns:
      true if this is a real LSN or false it it is NULL
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      textual representation of the stored LSN
    • toLongString

      public String toLongString()
      Return the LSN String for an official representation, like "LSN(7:0x8a209c)". Reference Informix 11.70 CDC API Programmer's Guide page 62 for more details.
      Returns:
      official textual representation of LSN.
    • logpos

      public long logpos()
      32bit position within the current log page
    • loguniq

      public long loguniq()
      32bit log page unique identifier
    • longValue

      public long longValue()
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Lsn o)
      Enables ordering of LSNs. The NULL LSN is always the smallest one.
      Specified by:
      compareTo in interface Comparable<Lsn>
    • isBetween

      public boolean isBetween(Lsn from, Lsn to)
      Verifies whether the LSN falls into a LSN interval
      Parameters:
      from - start of the interval (included)
      to - end of the interval (excluded)
      Returns:
      true if the LSN falls into the interval
    • increment

      public Lsn increment()
      Return the next LSN in sequence