/** * Read an operation from the stream * @return an operation from the stream or null if at end of stream * @throws IOException if there is an error reading from the stream */ public FSEditLogOp readOp() throws IOException { FSEditLogOp ret; if (cachedOp != null) { ret = cachedOp; cachedOp = null; return ret; } return nextOp(); }
/** * Get the next valid operation from the stream storage. * * This is exactly like nextOp, except that we attempt to skip over damaged * parts of the edit log * * @return an operation from the stream or null if at end of stream */ protected FSEditLogOp nextValidOp() { // This is a trivial implementation which just assumes that any errors mean // that there is nothing more of value in the log. Subclasses that support // error recovery will want to override this. try { return nextOp(); } catch (Throwable e) { return null; } }
/** * Read an operation from the stream * @return an operation from the stream or null if at end of stream * @throws IOException if there is an error reading from the stream */ public FSEditLogOp readOp() throws IOException { FSEditLogOp ret; if (cachedOp != null) { ret = cachedOp; cachedOp = null; return ret; } return nextOp(); }
/** * Read an operation from the stream * @return an operation from the stream or null if at end of stream * @throws IOException if there is an error reading from the stream */ public FSEditLogOp readOp() throws IOException { FSEditLogOp ret; if (cachedOp != null) { ret = cachedOp; cachedOp = null; return ret; } return nextOp(); }
/** * Get the next valid operation from the stream storage. * * This is exactly like nextOp, except that we attempt to skip over damaged * parts of the edit log * * @return an operation from the stream or null if at end of stream */ protected FSEditLogOp nextValidOp() { // This is a trivial implementation which just assumes that any errors mean // that there is nothing more of value in the log. Subclasses that support // error recovery will want to override this. try { return nextOp(); } catch (Throwable e) { return null; } }
/** * Get the next valid operation from the stream storage. * * This is exactly like nextOp, except that we attempt to skip over damaged * parts of the edit log * * @return an operation from the stream or null if at end of stream */ protected FSEditLogOp nextValidOp() { // This is a trivial implementation which just assumes that any errors mean // that there is nothing more of value in the log. Subclasses that support // error recovery will want to override this. try { return nextOp(); } catch (Throwable e) { return null; } }