/** * Used to initialize the WAL. Usually just call rollWriter to create the first log writer. */ public void init() throws IOException { rollWriter(); }
@Override public byte[][] rollWriter() throws FailedLogCloseException, IOException { return rollWriter(false); }
@Test(expected = WALClosedException.class) public void testRollWriterForClosedWAL() throws IOException { String testName = currentTest.getMethodName(); AbstractFSWAL<?> wal = newWAL(FS, CommonFSUtils.getWALRootDir(CONF), DIR.toString(), testName, CONF, null, true, null, null); wal.close(); wal.rollWriter(); } }
wal.rollWriter(); wal.rollWriter(); wal.rollWriter(); wal.rollWriter(true); wal.rollWriter(); wal.rollWriter(); wal.rollWriter(true); assertEquals(0, wal.getNumRolledLogFiles()); wal.rollWriter(); wal.completeCacheFlush(hri1.getEncodedNameAsBytes()); assertEquals(1, wal.getNumRolledLogFiles());
wal.rollWriter(); wal.rollWriter(); wal.rollWriter(); wal.rollWriter(true); wal.rollWriter(); wal.rollWriter(); wal.rollWriter(true); assertEquals(0, wal.getNumRolledLogFiles()); wal.rollWriter(); wal.completeCacheFlush(hri1.getEncodedNameAsBytes()); assertEquals(1, wal.getNumRolledLogFiles());