private BackupImage getBNImage() { return (BackupImage)nn.getFSImage(); }
private void verifySoftwareVersion(DatanodeRegistration dnReg) throws IncorrectVersionException { String dnVersion = dnReg.getSoftwareVersion(); if (VersionUtil.compareVersions(dnVersion, minimumDataNodeVersion) < 0) { IncorrectVersionException ive = new IncorrectVersionException( minimumDataNodeVersion, dnVersion, "DataNode", "NameNode"); LOG.warn(ive.getMessage() + " DN: " + dnReg); throw ive; } String nnVersion = VersionInfo.getVersion(); if (!dnVersion.equals(nnVersion)) { String messagePrefix = "Reported DataNode version '" + dnVersion + "' of DN " + dnReg + " does not match NameNode version '" + nnVersion + "'"; long nnCTime = nn.getFSImage().getStorage().getCTime(); long dnCTime = dnReg.getStorageInfo().getCTime(); if (nnCTime != dnCTime) { IncorrectVersionException ive = new IncorrectVersionException( messagePrefix + " and CTime of DN ('" + dnCTime + "') does not match CTime of NN ('" + nnCTime + "')"); LOG.warn(ive.toString(), ive); throw ive; } else { LOG.info(messagePrefix + ". Note: This is normal during a rolling upgrade."); } } }
NamenodeRegistration setRegistration() { nodeRegistration = new NamenodeRegistration( NetUtils.getHostPortString(getNameNodeAddress()), NetUtils.getHostPortString(getHttpAddress()), getFSImage().getStorage(), getRole()); return nodeRegistration; }
startHttpServer(conf); httpServer.setNameNodeAddress(getNameNodeAddress()); httpServer.setFSImage(getFSImage());
private BackupImage getBNImage() { return (BackupImage)nn.getFSImage(); }
incomingBlockReportRpc(nodeReg, context); if (nn.getFSImage().isUpgradeFinalized() && !namesystem.isRollingUpgrade() && !nn.isStandbyState() &&
httpServer.setFSImage(getFSImage());
public long getLastWrittenTxId() { if (getFSImage() != null && getFSImage().getEditLog() != null) { return getFSImage().getEditLog().getLastWrittenTxId(); } else { return -1; } }
/** * Returns the name of the fsImage file uploaded by periodic * checkpointing */ public File[] getFsImageNameCheckpoint() throws IOException { return getFSImage().getFsImageNameCheckpoint(); }
/** * Returns the name of the fsImage file */ public File getFsImageName() throws IOException { return getFSImage().getFsImageName(); }
/** * Returns the name of the fsImage file uploaded by periodic * checkpointing */ public File[] getFsImageNameCheckpoint() throws IOException { return getFSImage().getFsImageNameCheckpoint(); }
/** * Returns the name of the fsImage file */ public File getFsImageName() throws IOException { return getFSImage().getFsImageName(); }
/** get the fsImage*/ public static FSImage getFSImage(NameNode node) { return node.getFSImage(); }
@Test public void testLoadFsEditsShouldReturnTrueWhenEditsNewExists() throws Exception { nnConf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY, OUT_DIR + "/BNN1"); NameNode.format(nnConf); miniDFSCluster = new MiniDFSCluster.Builder(nnConf).numDataNodes(1).build(); FSImage image = miniDFSCluster.getNameNode().getFSImage(); URI next = miniDFSCluster.getNameDirs().iterator().next(); File editsNew = new File(next.getRawPath(), "/current/edits.new"); createEditsNew(editsNew, image); int loadFSEdits = image.loadFSEdits(image.getStorageDir(0)); assertEquals("The numEdits should not be zero.", 1, loadFSEdits); }
public DatanodeCommand blockReport(DatanodeRegistration nodeReg, long[] blocks) throws IOException { verifyRequest(nodeReg); BlockListAsLongs blist = new BlockListAsLongs(blocks); stateChangeLog.debug("*BLOCK* NameNode.blockReport: " +"from "+nodeReg.getName()+" "+blist.getNumberOfBlocks() +" blocks"); namesystem.processReport(nodeReg, blist); if (getFSImage().isUpgradeFinalized()) return DatanodeCommand.FINALIZE; return null; }
public static void abortEditLogs(NameNode nn) { FSEditLog el = nn.getFSImage().getEditLog(); el.abortCurrentLogSegment(); }
public static JournalSet spyOnJournalSet(NameNode nn) { FSEditLog editLog = nn.getFSImage().getEditLog(); JournalSet js = Mockito.spy(editLog.getJournalSet()); editLog.setJournalSetForTesting(js); return js; }
NamenodeRegistration setRegistration() { nodeRegistration = new NamenodeRegistration( NetUtils.getHostPortString(rpcServer.getRpcAddress()), NetUtils.getHostPortString(getHttpAddress()), getFSImage().getStorage(), getRole()); return nodeRegistration; }
NamenodeRegistration setRegistration() { nodeRegistration = new NamenodeRegistration( NetUtils.getHostPortString(rpcServer.getRpcAddress()), NetUtils.getHostPortString(getHttpAddress()), getFSImage().getStorage(), getRole()); return nodeRegistration; }
private void assertStorageDirsMatch(final NameNode nn, final BackupNode backup) throws Exception { // Check that the stored files in the name dirs are identical List<File> dirs = Lists.newArrayList( FSImageTestUtil.getCurrentDirs(nn.getFSImage().getStorage(), null)); dirs.addAll(FSImageTestUtil.getCurrentDirs(backup.getFSImage().getStorage(), null)); FSImageTestUtil.assertParallelFilesAreIdentical(dirs, ImmutableSet.of("VERSION")); }