Package io.debezium.connector.sqlserver
Class Lsn
- java.lang.Object
-
- io.debezium.connector.sqlserver.Lsn
-
- All Implemented Interfaces:
Nullable,Comparable<Lsn>
public class Lsn extends Object implements Comparable<Lsn>, Nullable
A logical representation of SQL Server LSN (log sequence number) position. When LSN is not available it is replaced withNULLconstant.- Author:
- Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]binarystatic LsnNULLprivate static StringNULL_STRINGprivate Stringstringprivate int[]unsignedBinary
-
Constructor Summary
Constructors Modifier Constructor Description privateLsn(byte[] binary)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Lsn o)Enables ordering of LSNs.booleanequals(Object obj)byte[]getBinary()private int[]getUnsignedBinary()inthashCode()booleanisAvailable()booleanisBetween(Lsn from, Lsn to)Verifies whether the LSN falls into a LSN intervalStringtoString()static LsnvalueOf(byte[] lsnBinary)static LsnvalueOf(String lsnString)
-
-
-
Field Detail
-
NULL_STRING
private static final String NULL_STRING
- See Also:
- Constant Field Values
-
NULL
public static final Lsn NULL
-
binary
private final byte[] binary
-
unsignedBinary
private int[] unsignedBinary
-
string
private String string
-
-
Method Detail
-
getBinary
public byte[] getBinary()
- Returns:
- binary representation of the stored LSN
-
isAvailable
public boolean isAvailable()
- Specified by:
isAvailablein interfaceNullable- Returns:
- true if this is a real LSN or false it it is
NULL
-
getUnsignedBinary
private int[] getUnsignedBinary()
-
toString
public String toString()
-
valueOf
public static Lsn valueOf(String lsnString)
- Parameters:
lsnString- - textual representation of Lsn- Returns:
- LSN converted from its textual representation
-
valueOf
public static Lsn valueOf(byte[] lsnBinary)
- Parameters:
lsnBinary- - binary representation of Lsn- Returns:
- LSN converted from its binary representation
-
compareTo
public int compareTo(Lsn o)
Enables ordering of LSNs. TheNULLLSN is always the smallest one.- Specified by:
compareToin interfaceComparable<Lsn>
-
-