public abstract class AbstractTransactionLog extends Object implements TransactionLog
TransactionLogWriter and TransactionLogReader.| 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 |
| Constructor and Description |
|---|
AbstractTransactionLog(long timestamp,
MetricsCollector metricsCollector) |
| 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() |
void |
init()
Initializes the log file, opening a file writer.
|
boolean |
isClosed() |
public AbstractTransactionLog(long timestamp,
MetricsCollector metricsCollector)
public void init()
throws IOException
init() should ensure that they
also call close().IOException - If an error is encountered initializing the file writer.protected abstract TransactionLogWriter createWriter() throws IOException
TransactionEdit objects.IOExceptionpublic abstract String getName()
getName in interface TransactionLogpublic long getTimestamp()
getTimestamp in interface TransactionLogpublic void append(TransactionEdit edit) throws IOException
append in interface TransactionLogIOExceptionpublic void append(List<TransactionEdit> edits) throws IOException
append in interface TransactionLogIOExceptionpublic void close()
throws IOException
close in interface TransactionLogIOExceptionpublic boolean isClosed()
public abstract TransactionLogReader getReader() throws IOException
getReader in interface TransactionLogIOExceptionCopyright © 2016 The Apache Software Foundation. All rights reserved.