public class LogRecordWithDLSN extends LogRecord
DLSN and SequenceId.
DLSN when it is
written to a log. At the mean time, a 64-bits long number is assigned to the record indicates its position
within a log, which is called SequenceId. Besides DLSN and SequenceID,
application can assign its own sequence number (called TransactionID) to the log record while
writing it.
TransactionID is DistributedLog Write Proxy. It assigns the non-decreasing
timestamps to log records, which the timestamps could be used as `physical time` to implement `TTL` in a strong
consistent database to achieve consistent `TTL` over replicas.
DLSN for more details).
The DLSN is usually used for comparison, positioning and truncation.
DLSN, in favor of answering questions like
`how many records written between two DLSNs`. It is a 64-bits monotonic increasing number (starting from zero).
Sequence ids are only accessible by readers. That means writers don't know the sequence ids of records after they
wrote them.LogRecord.Reader, LogRecord.WriterMAX_LOGRECORD_SIZE, MAX_LOGRECORDSET_SIZE| Constructor and Description |
|---|
LogRecordWithDLSN(DLSN dlsn,
long txid,
byte[] data,
long startSequenceIdOfCurrentSegment) |
| Modifier and Type | Method and Description |
|---|---|
DLSN |
getDlsn()
Get the DLSN of the record in the log.
|
long |
getSequenceId()
Get the sequence id of the record in the log.
|
String |
toString() |
getMetadata, getPayload, getPayLoadInputStream, getPositionWithinLogSegment, getTransactionId, isControl, isControl, isRecordSet, isRecordSet, readPayload, setControl, setMetadata, setRecordSet, setTransactionIdpublic LogRecordWithDLSN(DLSN dlsn, long txid, byte[] data, long startSequenceIdOfCurrentSegment)
public long getSequenceId()
public DLSN getDlsn()
Copyright © 2016. All Rights Reserved.