if (!doTransition(sd, nsInfo, startOpt, callables, datanode.getConf())) {
doTransition(getStorageDir(idx), nsInfo, startOpt); assert this.getLayoutVersion() == nsInfo.getLayoutVersion() : "Data-node and name-node layout versions must be the same.";
if (!doTransition(sd, nsInfo, startOpt, callables, datanode.getConf())) {
doTransition(storageDirs, nsInfo, startOpt);
synchronized Collection<StorageDirectory> recoverTransitionAdditionalRead(NamespaceInfo nsInfo, Collection<File> dataDirs, StartupOption startOpt ) throws IOException{ assert FSConstants.LAYOUT_VERSION == nsInfo.getLayoutVersion() : "Data-node and name-node layout versions must be the same."; // 1. For each data directory calculate its state and // check whether all is consistent before transitioning. // Format and recover. ArrayList<StorageDirectory> newDirs = analyzeStorageDirs(nsInfo, dataDirs, startOpt); // 2. Do transitions // Each storage directory is treated individually. // During startup some of them can upgrade or rollback // while others could be uptodate for the regular startup. doTransition(newDirs, nsInfo, startOpt); assert this.getLayoutVersion() == nsInfo.getLayoutVersion() : "Data-node and name-node layout versions must be the same."; assert this.getCTime() == nsInfo.getCTime() : "Data-node and name-node CTimes must be the same."; // 3. Update all storages. Some of them might have just been formatted. if (this.layoutVersion == 0) { layoutVersion = FSConstants.LAYOUT_VERSION; } for (StorageDirectory sd : newDirs) { sd.write(); } return newDirs; }
if (!doTransition(sd, nsInfo, startOpt, callables, datanode.getConf())) {