void openEditLogForWrite(int layoutVersion) throws IOException { assert editLog != null : "editLog must be initialized"; editLog.openForWrite(layoutVersion); storage.writeTransactionIdFileToStorage(editLog.getCurSegmentTxId()); }
@Override void openForWrite(int layoutVersion) throws IOException { try { startSyncThread(); super.openForWrite(layoutVersion); } catch (IOException ioe) { stopSyncThread(); throw ioe; } }
editLog.setNextTxId(nextTxId); getFSImage().editLog.openForWrite(getEffectiveLayoutVersion());
void openEditLogForWrite() throws IOException { assert editLog != null : "editLog must be initialized"; editLog.openForWrite(); storage.writeTransactionIdFileToStorage(editLog.getCurSegmentTxId()); }
void openEditLogForWrite() throws IOException { assert editLog != null : "editLog must be initialized"; editLog.openForWrite(); storage.writeTransactionIdFileToStorage(editLog.getCurSegmentTxId()); }
editLog.openForWrite(); addFiles(editLog, numFiles, replication, numBlocksPerFile, startingBlockId, blockSize, nameGenerator);
log.openForWrite(); NameNodeMetrics mockMetrics = Mockito.mock(NameNodeMetrics.class); log.setMetricsForTests(mockMetrics);
@Test public void testFailedOpen() throws Exception { File logDir = new File(TEST_DIR, "testFailedOpen"); logDir.mkdirs(); FSEditLog log = FSImageTestUtil.createStandaloneEditLog(logDir); try { FileUtil.setWritable(logDir, false); log.openForWrite(); fail("Did no throw exception on only having a bad dir"); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "too few journals successfully started", ioe); } finally { FileUtil.setWritable(logDir, true); log.close(); } }
spyLog.openForWrite(); assertTrue("should exist: " + inProgressFile, inProgressFile.exists());
editlog.openForWrite(); for (int i = 2; i < TXNS_PER_ROLL; i++) { editlog.logGenerationStampV2((long) 0);
editLog.setNextTxId(nextTxId); getFSImage().editLog.openForWrite();
/** * Create an aborted in-progress log in the given directory, containing * only a specified number of "mkdirs" operations. */ public static void createAbortedLogWithMkdirs(File editsLogDir, int numDirs, long firstTxId, long newInodeId) throws IOException { FSEditLog editLog = FSImageTestUtil.createStandaloneEditLog(editsLogDir); editLog.setNextTxId(firstTxId); editLog.openForWrite(); PermissionStatus perms = PermissionStatus.createImmutable("fakeuser", "fakegroup", FsPermission.createImmutable((short)0755)); for (int i = 1; i <= numDirs; i++) { String dirName = "dir" + i; INodeDirectory dir = new INodeDirectory(newInodeId + i - 1, DFSUtil.string2Bytes(dirName), perms, 0L); editLog.logMkDir("/" + dirName, dir); } editLog.logSync(); editLog.abortCurrentLogSegment(); }
editLog.setNextTxId(nextTxId); getFSImage().editLog.openForWrite();