Interface TxnLog
-
- All Known Implementing Classes:
FileTxnLog
public interface TxnLogInterface for reading transaction logs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTxnLog.TxnIteratoran iterating interface for reading transaction logs.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanappend(TxnHeader hdr, org.apache.jute.Record r)Append a request to the transaction logvoidclose()close the transactions logsvoidcommit()commmit the trasaction and make sure they are persistedlonggetDbId()the dbid for this transaction log.longgetLastLoggedZxid()the last zxid of the logged transactions.TxnLog.TxnIteratorread(long zxid)Start reading the transaction logs from a given zxidvoidrollLog()roll the current log being appended tovoidsetServerStats(ServerStats serverStats)+ * Setter for ServerStats to monitor fsync threshold exceed + * @param serverStats used to update fsyncThresholdExceedCount +booleantruncate(long zxid)truncate the log to get in sync with the leader.
-
-
-
Method Detail
-
setServerStats
void setServerStats(ServerStats serverStats)
+ * Setter for ServerStats to monitor fsync threshold exceed + * @param serverStats used to update fsyncThresholdExceedCount +
-
rollLog
void rollLog() throws java.io.IOExceptionroll the current log being appended to- Throws:
java.io.IOException
-
append
boolean append(TxnHeader hdr, org.apache.jute.Record r) throws java.io.IOException
Append a request to the transaction log- Parameters:
hdr- the transaction headerr- the transaction itself returns true iff something appended, otw false- Throws:
java.io.IOException
-
read
TxnLog.TxnIterator read(long zxid) throws java.io.IOException
Start reading the transaction logs from a given zxid- Parameters:
zxid-- Returns:
- returns an iterator to read the next transaction in the logs.
- Throws:
java.io.IOException
-
getLastLoggedZxid
long getLastLoggedZxid() throws java.io.IOExceptionthe last zxid of the logged transactions.- Returns:
- the last zxid of the logged transactions.
- Throws:
java.io.IOException
-
truncate
boolean truncate(long zxid) throws java.io.IOExceptiontruncate the log to get in sync with the leader.- Parameters:
zxid- the zxid to truncate at.- Throws:
java.io.IOException
-
getDbId
long getDbId() throws java.io.IOExceptionthe dbid for this transaction log.- Returns:
- the dbid for this transaction log.
- Throws:
java.io.IOException
-
commit
void commit() throws java.io.IOExceptioncommmit the trasaction and make sure they are persisted- Throws:
java.io.IOException
-
close
void close() throws java.io.IOExceptionclose the transactions logs- Throws:
java.io.IOException
-
-