public FSEditLog getEditLog() { return getFSImage().getEditLog(); }
/** * End checkpoint. * <p> * Validate the current storage info with the given signature. * * @param sig to validate the current storage info against * @throws IOException if the checkpoint fields are inconsistent */ void endCheckpoint(CheckpointSignature sig) throws IOException { LOG.info("End checkpoint at txid " + getEditLog().getLastWrittenTxId()); sig.validateStorageInfo(this); }
@Override synchronized public void close() throws IOException { if (editLog != null) { // 2NN doesn't have any edit log getEditLog().close(); } storage.close(); }
image.getEditLog().selectInputStreams( firstTxIdInLogs, curTxIdOnOtherNode, null, true); for (EditLogInputStream stream : streams) {
CheckpointSignature rollEditLog(int layoutVersion) throws IOException { getEditLog().rollEditLog(layoutVersion); // Record this log segment ID in all of the storage directories, so // we won't miss this log segment on a restart if the edits directories // go missing. storage.writeTransactionIdFileToStorage(getEditLog().getCurSegmentTxId()); //Update NameDirSize Metric getStorage().updateNameDirSize(); return new CheckpointSignature(this); }
FSEditLog log = getFSImage().getEditLog(); if (log != null) {
CheckpointSignature(FSImage fsImage) { super(fsImage.getStorage()); blockpoolID = fsImage.getBlockPoolID(); mostRecentCheckpointTxId = fsImage.getStorage().getMostRecentCheckpointTxId(); curSegmentTxId = fsImage.getEditLog().getCurSegmentTxId(); }
Lists.<URI>newArrayList(), sharedEditsDirs); sharedEditsImage.getEditLog().initJournalsForWrite(); sharedEditsImage.getEditLog().formatNonFileJournals(nsInfo, force); fsns.getFSImage().getEditLog().close(); fsns.getFSImage().getEditLog().initJournalsForWrite(); fsns.getFSImage().getEditLog().recoverUnclosedStreams();
getFSImage().getEditLog().abortCurrentLogSegment();
realImage.getEditLog().setNextTxId(ckptImage.getEditLog().getLastWrittenTxId()+1); realImage.initEditLog(StartupOption.IMPORT);
DFSConfigKeys.DFS_NAMENODE_INOTIFY_MAX_EVENTS_PER_RPC_KEY, DFSConfigKeys.DFS_NAMENODE_INOTIFY_MAX_EVENTS_PER_RPC_DEFAULT); FSEditLog log = namesystem.getFSImage().getEditLog(); long syncTxid = log.getSyncTxId();
try { FSNamesystem fsn = new FSNamesystem(conf, fsImage); fsImage.getEditLog().initJournalsForWrite();
/** * Register a Backup name-node, verifying that it belongs * to the correct namespace, and adding it to the set of * active journals if necessary. * * @param bnReg registration of the new BackupNode * @param nnReg registration of this NameNode * @throws IOException if the namespace IDs do not match */ void registerBackupNode(NamenodeRegistration bnReg, NamenodeRegistration nnReg) throws IOException { writeLock(); try { if(getFSImage().getStorage().getNamespaceID() != bnReg.getNamespaceID()) throw new IOException("Incompatible namespaceIDs: " + " Namenode namespaceID = " + getFSImage().getStorage().getNamespaceID() + "; " + bnReg.getRole() + " node namespaceID = " + bnReg.getNamespaceID()); if (bnReg.getRole() == NamenodeRole.BACKUP) { getFSImage().getEditLog().registerBackupNode( bnReg, nnReg); } } finally { writeUnlock("registerBackupNode"); } }
writeLock(); try { FSEditLog editLog = getFSImage().getEditLog();
image.getStorage().setStorageInfo(storage); image.initEditLog(StartupOption.REGULAR); assert image.getEditLog().isOpenForRead() : "Expected edit log to be open for read";
int layoutVersion) // active name-node throws IOException { LOG.info("Start checkpoint at txid " + getEditLog().getLastWrittenTxId()); String msg = null;
@Override synchronized public void close() throws IOException { if (editLog != null) { // 2NN doesn't have any edit log getEditLog().close(); } storage.close(); }
/** * Concat all the blocks from srcs to trg and delete the srcs files */ public void concatInternal(String target, String [] srcs) { // actual move waitForReady(); long now = FSNamesystem.now(); unprotectedConcat(target, srcs, now); fsImage.getEditLog().logConcat(target, srcs, now); }
/** * Pull out one of the JournalAndStream objects from the edit log. */ private JournalAndStream getJournalAndStream(int index) { FSImage fsimage = cluster.getNamesystem().getFSImage(); FSEditLog editLog = fsimage.getEditLog(); return editLog.getJournals().get(index); }
public static FSEditLog spyOnEditLog(NameNode nn) { FSEditLog spyEditLog = spy(nn.getNamesystem().getFSImage().getEditLog()); DFSTestUtil.setEditLogForTesting(nn.getNamesystem(), spyEditLog); EditLogTailer tailer = nn.getNamesystem().getEditLogTailer(); if (tailer != null) { tailer.setEditLog(spyEditLog); } return spyEditLog; }