public class JournalSet extends Object implements JournalManager
JournalManager.CorruptionException| Modifier and Type | Field and Description |
|---|---|
static Comparator<EditLogInputStream> |
EDIT_LOG_INPUT_STREAM_COMPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static void |
chainAndMakeRedundantStreams(Collection<EditLogInputStream> outStreams,
PriorityQueue<EditLogInputStream> allStreams,
long fromTxId) |
void |
close()
Close the journal manager, freeing any resources it may hold.
|
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.
|
RemoteEditLogManifest |
getEditLogManifest(long fromTxId,
boolean forReading)
Return a manifest of what finalized edit logs are available.
|
boolean |
hasSomeData() |
boolean |
isEmpty()
Returns true if there are no journals, all redundant journals are disabled,
or any required journals are disabled.
|
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 fromTxId,
boolean inProgressOk,
boolean forReading)
In this function, we get a bunch of streams from all of our JournalManager
objects.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic static final Comparator<EditLogInputStream> EDIT_LOG_INPUT_STREAM_COMPARATOR
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 close()
throws IOException
JournalManagerclose in interface Closeableclose in interface AutoCloseableclose in interface JournalManagerIOExceptionpublic void selectInputStreams(Collection<EditLogInputStream> streams, long fromTxId, boolean inProgressOk, boolean forReading) throws IOException
streams - The collection to add the streams to. It may or
may not be sorted-- this is up to the caller.fromTxId - The transaction ID to start looking for streams atinProgressOk - Should we consider unfinalized streams?forReading - Whether or not the caller intends to read from
the returned streams.IOException - if the underlying storage has an error or is otherwise
inaccessiblepublic static void chainAndMakeRedundantStreams(Collection<EditLogInputStream> outStreams, PriorityQueue<EditLogInputStream> allStreams, long fromTxId)
public boolean isEmpty()
public 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 RemoteEditLogManifest getEditLogManifest(long fromTxId, boolean forReading)
fromTxId - Starting transaction id to read the logs.Copyright © 2013 Apache Software Foundation. All rights reserved.