@InterfaceAudience.Private public class QuorumJournalManager extends Object implements JournalManager
JournalManager.CorruptionException| Constructor and Description |
|---|
QuorumJournalManager(Configuration conf,
URI uri,
NamespaceInfo nsInfo) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkJournalId(String jid) |
void |
close()
Close the journal manager, freeing any resources it may hold.
|
protected List<org.apache.hadoop.hdfs.qjournal.client.AsyncLogger> |
createLoggers(AsyncLogger.Factory factory) |
void |
finalizeLogSegment(long firstTxId,
long lastTxId)
Mark the log segment that spans from firstTxId to lastTxId
as finalized and complete.
|
void |
format(NamespaceInfo nsInfo)
Format the underlying storage, removing any previously
stored data.
|
boolean |
hasSomeData() |
void |
purgeLogsOlderThan(long minTxIdToKeep)
Remove all edit logs with transaction IDs lower than the given transaction
ID.
|
void |
recoverUnfinalizedSegments()
Recover segments which have not been finalized.
|
void |
selectInputStreams(Collection<EditLogInputStream> streams,
long fromTxnId,
boolean inProgressOk) |
void |
selectInputStreams(Collection<EditLogInputStream> streams,
long fromTxnId,
boolean inProgressOk,
boolean forReading)
Get a list of edit log input streams.
|
void |
setOutputBufferCapacity(int size)
Set the amount of memory that this stream should use to buffer edits
|
EditLogOutputStream |
startLogSegment(long txId)
Begin writing to a new segment of the log stream, which starts at
the given transaction ID.
|
String |
toString() |
public QuorumJournalManager(Configuration conf, URI uri, NamespaceInfo nsInfo) throws IOException
IOExceptionprotected List<org.apache.hadoop.hdfs.qjournal.client.AsyncLogger> createLoggers(AsyncLogger.Factory factory) throws IOException
IOExceptionpublic static void checkJournalId(String jid)
public void format(NamespaceInfo nsInfo) throws IOException
JournalManagerformat in interface JournalManagerIOExceptionpublic boolean hasSomeData()
throws IOException
hasSomeData in interface Storage.FormatConfirmableIOException - if the storage cannot be accessed at all.public EditLogOutputStream startLogSegment(long txId) throws IOException
JournalManagerstartLogSegment in interface JournalManagerIOExceptionpublic void finalizeLogSegment(long firstTxId,
long lastTxId)
throws IOException
JournalManagerfinalizeLogSegment in interface JournalManagerIOExceptionpublic void setOutputBufferCapacity(int size)
JournalManagersetOutputBufferCapacity in interface JournalManagerpublic void purgeLogsOlderThan(long minTxIdToKeep)
throws IOException
minTxIdToKeep - the lowest transaction ID that should be retainedIOException - in the event of errorpublic void recoverUnfinalizedSegments()
throws IOException
JournalManagerrecoverUnfinalizedSegments in interface JournalManagerIOExceptionpublic void close()
throws IOException
JournalManagerclose in interface Closeableclose in interface AutoCloseableclose in interface JournalManagerIOExceptionpublic void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException
IOExceptionpublic void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk, boolean forReading) throws IOException
fromTxnId - the first transaction id we want to readinProgressOk - whether or not in-progress streams should be returnedforReading - whether or not the caller intends to read from the edit logsIOException - if the underlying storage has an error or is otherwise
inaccessiblepublic String toString()
toString in interface Storage.FormatConfirmabletoString in class ObjectCopyright © 2013 Apache Software Foundation. All rights reserved.