Package io.debezium.connector.informix
Class Lsn
java.lang.Object
io.debezium.connector.informix.Lsn
- All Implemented Interfaces:
io.debezium.connector.Nullable,Comparable<Lsn>
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintEnables ordering of LSNs.booleaninthashCode()booleanlonglogpos()32bit position within the current log pagelongloguniq()32bit log page unique identifierstatic Lsnof(long loguniq, long logpos) Creates an LSN from a logical log file unique id and position within the log file.static LsnCreates an LSN object from a logical log sequence number.static LsnCreates an LSN object from a logical log sequence number's string representation.longsequence()Return the LSN String for an official representation, like "LSN(7,8a209c)".toString()
-
Field Details
-
NULL
-
LO_MASK
private static final long LO_MASK -
HI_MASK
private static final long HI_MASK -
sequence
-
-
Constructor Details
-
Lsn
Lsn(Long sequence)
-
-
Method Details
-
of
Creates an LSN object from a logical log sequence number's string representation.- Parameters:
sequence- - signed long integer string. We consider "NULL" and "-1L" as same as "new Lsn(-1)".- Returns:
- LSN converted from its textual representation
-
of
Creates an LSN object from a logical log sequence number.- Parameters:
sequence- logical sequence number- Returns:
- LSN representing the given sequence number
-
of
Creates an LSN from a logical log file unique id and position within the log file. The unique id is an integer that goes in the upper 32 bits of the 64 bit sequence number. The log position is a 32 bit adress within the log file and goes in the lower 32 bits of the sequence number.- Parameters:
loguniq- unique id of the logical log pagelogpos- position within the logical log page- Returns:
- LSN representing the given log file unique id and position within the log file
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceio.debezium.connector.Nullable- Returns:
- true if this is a real LSN or false it it is
NULL
-
toString
-
toLongString
Return the LSN String for an official representation, like "LSN(7,8a209c)". 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 -
sequence
public long sequence() -
hashCode
public int hashCode() -
equals
-
compareTo
Enables ordering of LSNs. TheNULLLSN is always the smallest one.- Specified by:
compareToin interfaceComparable<Lsn>
-