|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.server.namenode.EditLogInputStream
org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream
public class EditLogFileInputStream
An implementation of the abstract class EditLogInputStream
, which
reads edits from a local file.
Constructor Summary | |
---|---|
EditLogFileInputStream(File name,
long firstTxId,
long lastTxId,
boolean isInProgress)
Open an EditLogInputStream for the given file. |
Method Summary | |
---|---|
void |
close()
Close the stream. |
long |
getFirstTxId()
|
long |
getLastTxId()
|
String |
getName()
|
long |
getPosition()
Get the "position" of in the stream. |
int |
getVersion()
Get the layout version of the data in the stream. |
boolean |
isInProgress()
Return true if this stream is in progress, false if it is finalized. |
long |
length()
Return the size of the current edits log. |
protected org.apache.hadoop.hdfs.server.namenode.FSEditLogOp |
nextOp()
Get the next operation from the stream storage. |
protected org.apache.hadoop.hdfs.server.namenode.FSEditLogOp |
nextValidOp()
Get the next valid operation from the stream storage. |
String |
toString()
|
Methods inherited from class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream |
---|
readOp, resync, skipUntil |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EditLogFileInputStream(File name, long firstTxId, long lastTxId, boolean isInProgress) throws org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.LogHeaderCorruptException, IOException
name
- filename to openfirstTxId
- first transaction found in filelastTxId
- last transaction id found in file
LogHeaderCorruptException
- if the header is either missing or
appears to be corrupt/truncated
IOException
- if an actual IO error occurs while reading the
header
org.apache.hadoop.hdfs.server.namenode.EditLogFileInputStream.LogHeaderCorruptException
Method Detail |
---|
public long getFirstTxId() throws IOException
getFirstTxId
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
public long getLastTxId() throws IOException
getLastTxId
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
public String getName()
getName
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
protected org.apache.hadoop.hdfs.server.namenode.FSEditLogOp nextOp() throws IOException
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
nextOp
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
- if there is an error reading from the streamprotected org.apache.hadoop.hdfs.server.namenode.FSEditLogOp nextValidOp()
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
nextValidOp
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
public int getVersion() throws IOException
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
getVersion
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
- if there is an error reading the versionpublic long getPosition()
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
getPosition
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
public void close() throws IOException
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
close
in interface Closeable
close
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
- if an error occurred while closingpublic long length() throws IOException
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
length
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
IOException
public boolean isInProgress()
org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
isInProgress
in class org.apache.hadoop.hdfs.server.namenode.EditLogInputStream
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |