public abstract class AbstractTransactionLog extends Object implements TransactionLog
TransactionLogWriter
and TransactionLogReader
.
It is important to call close() on this class to ensure that all writes are synced and the log files are closed.Modifier and Type | Class and Description |
---|---|
static class |
AbstractTransactionLog.Entry
Represents an entry in the transaction log.
|
Modifier and Type | Field and Description |
---|---|
protected long |
timestamp |
Modifier and Type | Method and Description |
---|---|
void |
append(List<TransactionEdit> edits) |
void |
append(TransactionEdit edit) |
void |
close() |
protected abstract TransactionLogWriter |
createWriter()
Returns a log writer to be used for appending any new
TransactionEdit objects. |
abstract String |
getName() |
abstract TransactionLogReader |
getReader() |
long |
getTimestamp() |
boolean |
isClosed() |
protected abstract TransactionLogWriter createWriter() throws IOException
TransactionEdit
objects.IOException
public abstract String getName()
getName
in interface TransactionLog
public long getTimestamp()
getTimestamp
in interface TransactionLog
public void append(TransactionEdit edit) throws IOException
append
in interface TransactionLog
IOException
public void append(List<TransactionEdit> edits) throws IOException
append
in interface TransactionLog
IOException
public void close() throws IOException
close
in interface TransactionLog
IOException
public boolean isClosed()
public abstract TransactionLogReader getReader() throws IOException
getReader
in interface TransactionLog
IOException
Copyright © 2017 The Apache Software Foundation. All rights reserved.