@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
IOException
protected List<org.apache.hadoop.hdfs.qjournal.client.AsyncLogger> createLoggers(AsyncLogger.Factory factory) throws IOException
IOException
public static void checkJournalId(String jid)
public void format(NamespaceInfo nsInfo) throws IOException
JournalManager
format
in interface JournalManager
IOException
public boolean hasSomeData() throws IOException
hasSomeData
in interface Storage.FormatConfirmable
IOException
- if the storage cannot be accessed at all.public EditLogOutputStream startLogSegment(long txId) throws IOException
JournalManager
startLogSegment
in interface JournalManager
IOException
public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException
JournalManager
finalizeLogSegment
in interface JournalManager
IOException
public void setOutputBufferCapacity(int size)
JournalManager
setOutputBufferCapacity
in interface JournalManager
public void purgeLogsOlderThan(long minTxIdToKeep) throws IOException
minTxIdToKeep
- the lowest transaction ID that should be retainedIOException
- in the event of errorpublic void recoverUnfinalizedSegments() throws IOException
JournalManager
recoverUnfinalizedSegments
in interface JournalManager
IOException
public void close() throws IOException
JournalManager
close
in interface Closeable
close
in interface AutoCloseable
close
in interface JournalManager
IOException
public void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxnId, boolean inProgressOk) throws IOException
IOException
public 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.FormatConfirmable
toString
in class Object
Copyright © 2013 Apache Software Foundation. All rights reserved.