/** * Append to the WAL. Does all CP and WAL listener calls. */ void append(final FSWALEntry entry) throws Exception { try { FSHLog.this.append(writer, entry); } catch (Exception e) { String msg = "Append sequenceId=" + entry.getKey().getSequenceId() + ", requesting roll of WAL"; LOG.warn(msg, e); requestLogRoll(); throw new DamagedWALException(msg, e); } }
@Override public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException { if (logKey.getTableName().getNameAsString().equalsIgnoreCase("sleep")) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } if (logKey.getTableName().getNameAsString() .equalsIgnoreCase("DamagedWALException")) { throw new DamagedWALException("Failed appending"); } }
: new DamagedWALException("On sync", this.exception)); this.exception = new DamagedWALException("Failed offering sync", e); ? this.exception : new DamagedWALException("On sync", this.exception));
@Override public void visitLogEntryBeforeWrite(WALKey logKey, WALEdit logEdit) throws IOException { if (logKey.getTableName().getNameAsString().equalsIgnoreCase("sleep")) { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } if (logKey.getTableName().getNameAsString() .equalsIgnoreCase("DamagedWALException")) { throw new DamagedWALException("Failed appending"); } }
this.exception = new DamagedWALException("Failed offering sync", e); this.exception instanceof DamagedWALException? this.exception: new DamagedWALException("On sync", this.exception));
LOG.warn(msg, e); requestLogRoll(); throw new DamagedWALException(msg, e);