@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class EditLogInputStream extends Object implements Closeable
EditLogOutputStream
.Constructor and Description |
---|
EditLogInputStream() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Close the stream.
|
String |
getCurrentStreamName()
Returns the name of the currently active underlying stream.
|
abstract long |
getFirstTxId() |
abstract long |
getLastTxId() |
abstract String |
getName() |
abstract long |
getPosition()
Get the "position" of in the stream.
|
abstract int |
getVersion()
Get the layout version of the data in the stream.
|
abstract boolean |
isInProgress()
Return true if this stream is in progress, false if it is finalized.
|
abstract long |
length()
Return the size of the current edits log or -1 if unknown.
|
protected abstract FSEditLogOp |
nextOp()
Get the next operation from the stream storage.
|
protected FSEditLogOp |
nextValidOp()
Get the next valid operation from the stream storage.
|
FSEditLogOp |
readOp()
Read an operation from the stream
|
void |
resync()
Position the stream so that a valid operation can be read from it with
readOp().
|
abstract void |
setMaxOpSize(int maxOpSize)
Set the maximum opcode size in bytes.
|
boolean |
skipUntil(long txid)
Skip edit log operations up to a given transaction ID, or until the
end of the edit log is reached.
|
public String getCurrentStreamName()
public abstract String getName()
public abstract long getFirstTxId()
public abstract long getLastTxId()
public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an error occurred while closingpublic FSEditLogOp readOp() throws IOException
IOException
- if there is an error reading from the streampublic void resync()
protected abstract FSEditLogOp nextOp() throws IOException
IOException
- if there is an error reading from the streamprotected FSEditLogOp nextValidOp()
public boolean skipUntil(long txid) throws IOException
txid
- The transaction ID to read up until.IOException
public abstract int getVersion() throws IOException
IOException
- if there is an error reading the versionpublic abstract long getPosition()
public abstract long length() throws IOException
IOException
public abstract boolean isInProgress()
public abstract void setMaxOpSize(int maxOpSize)
Copyright © 2013 Apache Software Foundation. All rights reserved.