public interface TxnLog extends Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TxnLog.TxnIterator
an iterating interface for reading
transaction logs.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
append(TxnHeader hdr,
Record r)
Append a request to the transaction log
|
boolean |
append(TxnHeader hdr,
Record r,
TxnDigest digest)
Append a request to the transaction log with a digset
|
void |
close()
close the transactions logs
|
void |
commit()
commit the transaction and make sure
they are persisted
|
long |
getDbId()
the dbid for this transaction log.
|
long |
getLastLoggedZxid()
the last zxid of the logged transactions.
|
long |
getTotalLogSize()
Gets the total size of all log files
|
long |
getTxnLogSyncElapsedTime() |
TxnLog.TxnIterator |
read(long zxid)
Start reading the transaction logs
from a given zxid
|
void |
rollLog()
roll the current
log being appended to
|
void |
setServerStats(ServerStats serverStats)
Setter for ServerStats to monitor fsync threshold exceed
|
void |
setTotalLogSize(long size)
Sets the total size of all log files
|
boolean |
truncate(long zxid)
truncate the log to get in sync with the
leader.
|
void setServerStats(ServerStats serverStats)
serverStats - used to update fsyncThresholdExceedCountvoid rollLog()
throws IOException
IOExceptionboolean append(TxnHeader hdr, Record r) throws IOException
hdr - the transaction headerr - the transaction itselfIOExceptionboolean append(TxnHeader hdr, Record r, TxnDigest digest) throws IOException
hdr - the transaction headerr - the transaction itselfdigest - transaction digest
returns true iff something appended, otw falseIOExceptionTxnLog.TxnIterator read(long zxid) throws IOException
zxid - IOExceptionlong getLastLoggedZxid()
throws IOException
IOExceptionboolean truncate(long zxid)
throws IOException
zxid - the zxid to truncate at.IOExceptionlong getDbId()
throws IOException
IOExceptionvoid commit()
throws IOException
IOExceptionlong getTxnLogSyncElapsedTime()
void close()
throws IOException
close in interface AutoCloseableclose in interface CloseableIOExceptionvoid setTotalLogSize(long size)
long getTotalLogSize()
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.