/** * Override close() so that we don't finalize edit logs. */ @Override public synchronized void close() throws IOException { editLog.abortCurrentLogSegment(); storage.close(); } }
/** * Remote namenode just has started a log segment, start log segment locally. */ public synchronized void startLogSegment(long txid, boolean abortCurrentLogSegment, int layoutVersion) throws IOException { LOG.info("Started a new log segment at txid " + txid); if (isSegmentOpen()) { if (getLastWrittenTxId() == txid - 1) { //In sync with the NN, so end and finalize the current segment` endCurrentLogSegment(false); } else { //Missed some transactions: probably lost contact with NN temporarily. final String mess = "Cannot start a new log segment at txid " + txid + " since only up to txid " + getLastWrittenTxId() + " have been written in the log segment starting at " + getCurSegmentTxId() + "."; if (abortCurrentLogSegment) { //Mark the current segment as aborted. LOG.warn(mess); abortCurrentLogSegment(); } else { throw new IOException(mess); } } } setNextTxId(txid); startLogSegment(txid, layoutVersion); }
getFSImage().getEditLog().abortCurrentLogSegment();
/** * Override close() so that we don't finalize edit logs. */ @Override public synchronized void close() throws IOException { editLog.abortCurrentLogSegment(); storage.close(); } }
/** * Override close() so that we don't finalize edit logs. */ @Override public synchronized void close() throws IOException { editLog.abortCurrentLogSegment(); storage.close(); } }
public static void abortEditLogs(NameNode nn) { FSEditLog el = nn.getFSImage().getEditLog(); el.abortCurrentLogSegment(); }
editLog.getCurSegmentTxId() + ". Aborting this " + "log segment."); editLog.abortCurrentLogSegment();
getFSImage().getEditLog().abortCurrentLogSegment();
editLog.getCurSegmentTxId() + ". Aborting this " + "log segment."); editLog.abortCurrentLogSegment();
getFSImage().getEditLog().abortCurrentLogSegment();
/** * 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(); }