public class DLSN extends Object implements Comparable<DLSN>
DLSN is comprised with 3 components:
LogRecordWithDLSN| Modifier and Type | Field and Description |
|---|---|
static DLSN |
InitialDLSN |
static DLSN |
InvalidDLSN |
static DLSN |
NonInclusiveLowerBound |
static byte |
VERSION0 |
static byte |
VERSION1 |
| Constructor and Description |
|---|
DLSN(long logSegmentSequenceNo,
long entryId,
long slotId) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DLSN that) |
static DLSN |
deserialize(String dlsn)
Deserialize the DLSN from base64 encoded string
dlsn. |
static DLSN |
deserializeBytes(byte[] data)
Deserialize the DLSN from bytes array.
|
boolean |
equals(Object o) |
long |
getEntryId()
Return the entry id of the batch that the record is written to.
|
long |
getLogSegmentSequenceNo()
Return the sequence number of the log segment that the record is written to.
|
DLSN |
getNextDLSN()
Positions to a DLSN greater than the current value - this may not
correspond to an actual LogRecord, its just used by the positioning logic
to position the reader
|
long |
getSlotId()
Return the slot id in the batch that the record is written to.
|
int |
hashCode() |
DLSN |
positionOnTheNextLedger()
Positions to a DLSN greater than the current value - this may not
correspond to an actual LogRecord, its just used by the positioning logic
to position the reader
|
String |
serialize()
Serialize the DLSN into base64 encoded string.
|
String |
serialize(byte version)
Serialize the DLSN into base64 encoded string with given
version. |
byte[] |
serializeBytes()
Serialize the DLSN into bytes with current version.
|
byte[] |
serializeBytes(byte version)
Serialize the DLSN into bytes with given
version. |
String |
toString() |
public static final byte VERSION0
public static final byte VERSION1
public static final DLSN InitialDLSN
public static final DLSN NonInclusiveLowerBound
public static final DLSN InvalidDLSN
public long getLogSegmentSequenceNo()
public long getEntryId()
public long getSlotId()
public int compareTo(DLSN that)
compareTo in interface Comparable<DLSN>public byte[] serializeBytes()
public byte[] serializeBytes(byte version)
version.version - version to serialize the DLSNpublic String serialize()
serializeBytes()public String serialize(byte version)
version.version - version to serialize the DLSNserializeBytes(byte)public static DLSN deserialize(String dlsn)
dlsn.dlsn - base64 encoded stringpublic static DLSN deserializeBytes(byte[] data)
data - serialized bytespublic DLSN getNextDLSN()
public DLSN positionOnTheNextLedger()
Copyright © 2016. All Rights Reserved.