boolean isSameCluster(FSImage si) { return namespaceID == si.getStorage().namespaceID && clusterID.equals(si.getClusterID()) && blockpoolID.equals(si.getBlockPoolID()); }
CheckpointSignature(FSImage fsImage) { super(fsImage.getStorage()); blockpoolID = fsImage.getBlockPoolID(); mostRecentCheckpointTxId = fsImage.getStorage().getMostRecentCheckpointTxId(); curSegmentTxId = fsImage.getEditLog().getCurSegmentTxId(); }
/** * Load in the filesystem image from file. It's a big list of * filenames and blocks. */ private void loadFSImage(File curFile, MD5Hash expectedMd5, FSNamesystem target, MetaRecoveryContext recovery, boolean requireSameLayoutVersion) throws IOException { // BlockPoolId is required when the FsImageLoader loads the rolling upgrade // information. Make sure the ID is properly set. target.setBlockPoolId(this.getBlockPoolID()); FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target); loader.load(curFile, requireSameLayoutVersion); // Check that the image digest we loaded matches up with what // we expected MD5Hash readImageMd5 = loader.getLoadedImageMd5(); if (expectedMd5 != null && !expectedMd5.equals(readImageMd5)) { throw new IOException("Image file " + curFile + " is corrupt with MD5 checksum of " + readImageMd5 + " but expecting " + expectedMd5); } long txId = loader.getLoadedImageTxId(); LOG.info("Loaded image for txid " + txId + " from " + curFile); lastAppliedTxId = txId; storage.setMostRecentCheckpointInfo(txId, curFile.lastModified()); }
void validateStorageInfo(FSImage si) throws IOException { if (!isSameCluster(si) || !storageVersionMatches(si.getStorage())) { throw new IOException("Inconsistent checkpoint fields.\n" + "LV = " + layoutVersion + " namespaceID = " + namespaceID + " cTime = " + cTime + " ; clusterId = " + clusterID + " ; blockpoolId = " + blockpoolID + ".\nExpecting respectively: " + si.getStorage().layoutVersion + "; " + si.getStorage().namespaceID + "; " + si.getStorage().cTime + "; " + si.getClusterID() + "; " + si.getBlockPoolID() + "."); } }
realImage.initEditLog(StartupOption.IMPORT); realImage.getStorage().setBlockPoolID(ckptImage.getBlockPoolID());
boolean isSameCluster(FSImage si) { return namespaceID == si.getStorage().namespaceID && clusterID.equals(si.getClusterID()) && blockpoolID.equals(si.getBlockPoolID()); }
boolean isSameCluster(FSImage si) { return namespaceID == si.getStorage().namespaceID && clusterID.equals(si.getClusterID()) && blockpoolID.equals(si.getBlockPoolID()); }
CheckpointSignature(FSImage fsImage) { super(fsImage.getStorage()); blockpoolID = fsImage.getBlockPoolID(); mostRecentCheckpointTxId = fsImage.getStorage().getMostRecentCheckpointTxId(); curSegmentTxId = fsImage.getEditLog().getCurSegmentTxId(); }
/** * Load in the filesystem image from file. It's a big list of * filenames and blocks. */ private void loadFSImage(File curFile, MD5Hash expectedMd5, FSNamesystem target, MetaRecoveryContext recovery, boolean requireSameLayoutVersion) throws IOException { // BlockPoolId is required when the FsImageLoader loads the rolling upgrade // information. Make sure the ID is properly set. target.setBlockPoolId(this.getBlockPoolID()); FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target); loader.load(curFile, requireSameLayoutVersion); // Check that the image digest we loaded matches up with what // we expected MD5Hash readImageMd5 = loader.getLoadedImageMd5(); if (expectedMd5 != null && !expectedMd5.equals(readImageMd5)) { throw new IOException("Image file " + curFile + " is corrupt with MD5 checksum of " + readImageMd5 + " but expecting " + expectedMd5); } long txId = loader.getLoadedImageTxId(); LOG.info("Loaded image for txid " + txId + " from " + curFile); lastAppliedTxId = txId; storage.setMostRecentCheckpointInfo(txId, curFile.lastModified()); }
CheckpointSignature(FSImage fsImage) { super(fsImage.getStorage()); blockpoolID = fsImage.getBlockPoolID(); mostRecentCheckpointTxId = fsImage.getStorage().getMostRecentCheckpointTxId(); curSegmentTxId = fsImage.getEditLog().getCurSegmentTxId(); }
void validateStorageInfo(FSImage si) throws IOException { if (!isSameCluster(si) || !storageVersionMatches(si.getStorage())) { throw new IOException("Inconsistent checkpoint fields.\n" + "LV = " + layoutVersion + " namespaceID = " + namespaceID + " cTime = " + cTime + " ; clusterId = " + clusterID + " ; blockpoolId = " + blockpoolID + ".\nExpecting respectively: " + si.getStorage().layoutVersion + "; " + si.getStorage().namespaceID + "; " + si.getStorage().cTime + "; " + si.getClusterID() + "; " + si.getBlockPoolID() + "."); } }
void validateStorageInfo(FSImage si) throws IOException { if (!isSameCluster(si) || !storageVersionMatches(si.getStorage())) { throw new IOException("Inconsistent checkpoint fields.\n" + "LV = " + layoutVersion + " namespaceID = " + namespaceID + " cTime = " + cTime + " ; clusterId = " + clusterID + " ; blockpoolId = " + blockpoolID + ".\nExpecting respectively: " + si.getStorage().layoutVersion + "; " + si.getStorage().namespaceID + "; " + si.getStorage().cTime + "; " + si.getClusterID() + "; " + si.getBlockPoolID() + "."); } }
/** * Load in the filesystem image from file. It's a big list of * filenames and blocks. */ private void loadFSImage(File curFile, MD5Hash expectedMd5, FSNamesystem target, MetaRecoveryContext recovery, boolean requireSameLayoutVersion) throws IOException { // BlockPoolId is required when the FsImageLoader loads the rolling upgrade // information. Make sure the ID is properly set. target.setBlockPoolId(this.getBlockPoolID()); FSImageFormat.LoaderDelegator loader = FSImageFormat.newLoader(conf, target); loader.load(curFile, requireSameLayoutVersion); // Check that the image digest we loaded matches up with what // we expected MD5Hash readImageMd5 = loader.getLoadedImageMd5(); if (expectedMd5 != null && !expectedMd5.equals(readImageMd5)) { throw new IOException("Image file " + curFile + " is corrupt with MD5 checksum of " + readImageMd5 + " but expecting " + expectedMd5); } long txId = loader.getLoadedImageTxId(); LOG.info("Loaded image for txid " + txId + " from " + curFile); lastAppliedTxId = txId; storage.setMostRecentCheckpointInfo(txId, curFile.lastModified()); }
realImage.initEditLog(StartupOption.IMPORT); realImage.getStorage().setBlockPoolID(ckptImage.getBlockPoolID());
realImage.initEditLog(StartupOption.IMPORT); realImage.getStorage().setBlockPoolID(ckptImage.getBlockPoolID());
assertNotNull("cannot create nn1", nn1); String bpid1 = FSImageTestUtil.getFSImage(nn1).getBlockPoolID(); String cid1 = FSImageTestUtil.getFSImage(nn1).getClusterID(); int lv1 = FSImageTestUtil.getFSImage(nn1).getLayoutVersion();
assertNotNull("cannot create nn2", nn2); String bpid1 = FSImageTestUtil.getFSImage(nn1).getBlockPoolID(); String bpid2 = FSImageTestUtil.getFSImage(nn2).getBlockPoolID(); String cid1 = FSImageTestUtil.getFSImage(nn1).getClusterID(); String cid2 = FSImageTestUtil.getFSImage(nn2).getClusterID();