@Override protected FSEditLogOp nextValidOp() { try { return reader.readOp(true); } catch (IOException e) { throw new RuntimeException("got unexpected IOException " + e, e); } }
@Override protected FSEditLogOp nextOp() throws IOException { Preconditions.checkState(reader != null, "Must call setBytes() before readOp()"); return reader.readOp(false); }
private void dumpRemainingEditLogs() { byte[] buf = this.getData(); byte[] remainingRawEdits = Arrays.copyOfRange(buf, 0, this.size()); ByteArrayInputStream bis = new ByteArrayInputStream(remainingRawEdits); DataInputStream dis = new DataInputStream(bis); FSEditLogLoader.PositionTrackingInputStream tracker = new FSEditLogLoader.PositionTrackingInputStream(bis); FSEditLogOp.Reader reader = FSEditLogOp.Reader.create(dis, tracker, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION); FSEditLogOp op; LOG.warn("The edits buffer is " + size() + " bytes long with " + numTxns + " unflushed transactions. " + "Below is the list of unflushed transactions:"); int numTransactions = 0; try { while ((op = reader.readOp(false)) != null) { LOG.warn("Unflushed op [" + numTransactions + "]: " + op); numTransactions++; } } catch (IOException ioe) { // If any exceptions, print raw bytes and stop. LOG.warn("Unable to dump remaining ops. Remaining raw bytes: " + Hex.encodeHexString(remainingRawEdits), ioe); } } }
return nextOpImpl(skipBrokenEdits); case OPEN: op = reader.readOp(skipBrokenEdits); if ((op != null) && (op.hasTransactionId())) { long txId = op.getTransactionId();
return nextOpImpl(skipBrokenEdits); case OPEN: op = reader.readOp(skipBrokenEdits); if ((op != null) && (op.hasTransactionId())) { long txId = op.getTransactionId();
@Override public FSEditLogOp readOp() throws IOException { return reader.readOp(); }
@Override protected FSEditLogOp nextOp() throws IOException { return reader.readOp(false); }
@Override protected FSEditLogOp nextOp() throws IOException { Preconditions.checkState(reader != null, "Must call setBytes() before readOp()"); return reader.readOp(false); }
@Override protected FSEditLogOp nextValidOp() { try { return reader.readOp(true); } catch (IOException e) { throw new RuntimeException("got unexpected IOException " + e, e); } }
@Override protected FSEditLogOp nextValidOp() { try { return reader.readOp(true); } catch (IOException e) { throw new RuntimeException("got unexpected IOException " + e, e); } }
@Override protected FSEditLogOp nextOp() throws IOException { Preconditions.checkState(reader != null, "Must call setBytes() before readOp()"); return reader.readOp(false); }
return nextOpImpl(skipBrokenEdits); case OPEN: op = reader.readOp(skipBrokenEdits); if ((op != null) && (op.hasTransactionId())) { long txId = op.getTransactionId();