org.apache.hadoop.hdfs.server.namenode
Class FSEditLogOp.Reader

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.namenode.FSEditLogOp.Reader
Enclosing class:
org.apache.hadoop.hdfs.server.namenode.FSEditLogOp

public static class FSEditLogOp.Reader
extends Object

Class for reading editlog ops from a stream


Constructor Summary
FSEditLogOp.Reader(DataInputStream in, org.apache.hadoop.hdfs.server.namenode.StreamLimiter limiter, int logVersion)
          Construct the reader
 
Method Summary
 org.apache.hadoop.hdfs.server.namenode.FSEditLogOp readOp(boolean skipBrokenEdits)
          Read an operation from the input stream.
 long scanOp()
          Similar with decodeOp(), but instead of doing the real decoding, we skip the content of the op if the length of the editlog is supported.
 void setMaxOpSize(int maxOpSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSEditLogOp.Reader

public FSEditLogOp.Reader(DataInputStream in,
                          org.apache.hadoop.hdfs.server.namenode.StreamLimiter limiter,
                          int logVersion)
Construct the reader

Parameters:
in - The stream to read from.
logVersion - The version of the data coming from the stream.
Method Detail

setMaxOpSize

public void setMaxOpSize(int maxOpSize)

readOp

public org.apache.hadoop.hdfs.server.namenode.FSEditLogOp readOp(boolean skipBrokenEdits)
                                                          throws IOException
Read an operation from the input stream. Note that the objects returned from this method may be re-used by future calls to the same method.

Parameters:
skipBrokenEdits - If true, attempt to skip over damaged parts of the input stream, rather than throwing an IOException
Returns:
the operation read from the stream, or null at the end of the file
Throws:
IOException - on error. This function should only throw an exception when skipBrokenEdits is false.

scanOp

public long scanOp()
            throws IOException
Similar with decodeOp(), but instead of doing the real decoding, we skip the content of the op if the length of the editlog is supported.

Returns:
the last txid of the segment, or INVALID_TXID on exception
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.