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.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 © 2016 The Apache Software Foundation. All rights reserved.