@Override public void visitOp(FSEditLogOp op) throws IOException { elfos.write(op); } }
@Override public void visitOp(FSEditLogOp op) throws IOException { elfos.write(op); } }
@Override public void visitOp(FSEditLogOp op) throws IOException { elfos.write(op); } }
/** * Replace the journal at index <code>index</code> with one that throws an * exception on flush. * * @param index the index of the journal to take offline. * @return the original <code>EditLogOutputStream</code> of the journal. */ private void invalidateEditsDirAtIndex(int index, boolean failOnFlush, boolean failOnWrite) throws IOException { JournalAndStream jas = getJournalAndStream(index); EditLogFileOutputStream spyElos = spyOnStream(jas); if (failOnWrite) { doThrow(new IOException("fail on write()")).when(spyElos).write( (FSEditLogOp) any()); } if (failOnFlush) { doThrow(new IOException("fail on flush()")).when(spyElos).flush(); } else { doThrow(new IOException("fail on setReadyToFlush()")).when(spyElos) .setReadyToFlush(); } }