public void clearTrash(String bpid) { if (trashEnabledBpids.contains(bpid)) { getBPStorage(bpid).clearTrash(); trashEnabledBpids.remove(bpid); LOG.info("Cleared trash for bpid {}", bpid); } }
/** * Enable trash for the specified block pool storage. Even if trash is * enabled by the caller, it is superseded by the 'previous' directory * if a layout upgrade is in progress. */ public void enableTrash(String bpid) { if (trashEnabledBpids.add(bpid)) { getBPStorage(bpid).stopTrashCleaner(); LOG.info("Enabled trash for bpid {}", bpid); } }
/** * If rolling upgrades are in progress then do not delete block files * immediately. Instead we move the block files to an intermediate * 'trash' directory. If there is a subsequent rollback, then the block * files will be restored from trash. * * @return trash directory if rolling upgrade is in progress, null * otherwise. */ public String getTrashDirectoryForReplica(String bpid, ReplicaInfo info) { if (trashEnabledBpids.contains(bpid)) { return getBPStorage(bpid).getTrashDirectory(info); } return null; }
public void clearRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).clearRollingUpgradeMarkers(getStorageDirs()); }
public void setRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).setRollingUpgradeMarkers(getStorageDirs()); }
/** * Create a DatanodeRegistration for a specific block pool. * @param nsInfo the namespace info from the first part of the NN handshake */ DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) { StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID()); if (storageInfo == null) { // it's null in the case of SimulatedDataSet storageInfo = new StorageInfo( DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION, nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(), NodeType.DATA_NODE); } DatanodeID dnId = new DatanodeID( streamingAddr.getAddress().getHostAddress(), hostName, storage.getDatanodeUuid(), getXferPort(), getInfoPort(), infoSecurePort, getIpcPort()); return new DatanodeRegistration(dnId, storageInfo, new ExportedBlockKeys(), VersionInfo.getVersion()); }
storage.recoverTransitionRead(this, nsInfo, dataDirs, startOpt); final StorageInfo bpStorage = storage.getBPStorage(bpid); LOG.info("Setting up storage: nsid={};bpid={};lv={};" + "nsInfo={};dnuuid={}",
/** * Enable trash for the specified block pool storage. Even if trash is * enabled by the caller, it is superseded by the 'previous' directory * if a layout upgrade is in progress. */ public void enableTrash(String bpid) { if (trashEnabledBpids.add(bpid)) { getBPStorage(bpid).stopTrashCleaner(); LOG.info("Enabled trash for bpid " + bpid); } }
public void clearTrash(String bpid) { if (trashEnabledBpids.contains(bpid)) { getBPStorage(bpid).clearTrash(); trashEnabledBpids.remove(bpid); LOG.info("Cleared trash for bpid " + bpid); } }
public void clearRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).clearRollingUpgradeMarkers(storageDirs); }
public void clearRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).clearRollingUpgradeMarkers(storageDirs); }
public void setRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).setRollingUpgradeMarkers(storageDirs); }
public void setRollingUpgradeMarker(String bpid) throws IOException { getBPStorage(bpid).setRollingUpgradeMarkers(storageDirs); }
/** * If rolling upgrades are in progress then do not delete block files * immediately. Instead we move the block files to an intermediate * 'trash' directory. If there is a subsequent rollback, then the block * files will be restored from trash. * * @return trash directory if rolling upgrade is in progress, null * otherwise. */ public String getTrashDirectoryForBlockFile(String bpid, File blockFile) { if (trashEnabledBpids.contains(bpid)) { return getBPStorage(bpid).getTrashDirectory(blockFile); } return null; }
/** * If rolling upgrades are in progress then do not delete block files * immediately. Instead we move the block files to an intermediate * 'trash' directory. If there is a subsequent rollback, then the block * files will be restored from trash. * * @return trash directory if rolling upgrade is in progress, null * otherwise. */ public String getTrashDirectoryForBlockFile(String bpid, File blockFile) { if (trashEnabledBpids.contains(bpid)) { return getBPStorage(bpid).getTrashDirectory(blockFile); } return null; }
public void clearTrash(String bpid) { if (trashEnabledBpids.contains(bpid)) { getBPStorage(bpid).clearTrash(); trashEnabledBpids.remove(bpid); LOG.info("Cleared trash for bpid " + bpid); } }
/** * Enable trash for the specified block pool storage. Even if trash is * enabled by the caller, it is superseded by the 'previous' directory * if a layout upgrade is in progress. */ public void enableTrash(String bpid) { if (trashEnabledBpids.add(bpid)) { getBPStorage(bpid).stopTrashCleaner(); LOG.info("Enabled trash for bpid " + bpid); } }
private boolean isTrashRootPresent() { // Trash is disabled; trash root does not exist BlockPoolSliceStorage bps = dn0.getStorage().getBPStorage(blockPoolId); return bps.trashEnabled(); }
/** * Create a DatanodeRegistration for a specific block pool. * @param nsInfo the namespace info from the first part of the NN handshake */ DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) { StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID()); if (storageInfo == null) { // it's null in the case of SimulatedDataSet storageInfo = new StorageInfo( DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION, nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(), NodeType.DATA_NODE); } DatanodeID dnId = new DatanodeID( streamingAddr.getAddress().getHostAddress(), hostName, storage.getDatanodeUuid(), getXferPort(), getInfoPort(), infoSecurePort, getIpcPort()); return new DatanodeRegistration(dnId, storageInfo, new ExportedBlockKeys(), VersionInfo.getVersion()); }
private void finalizeRollingUpgrade() throws Exception { LOG.info("Finalizing rolling upgrade"); final DFSAdmin dfsadmin = new DFSAdmin(conf); TestRollingUpgrade.runCmd(dfsadmin, true, "-rollingUpgrade", "finalize"); triggerHeartBeats(); // Ensure datanode rolling upgrade is started assertFalse(dn0.getFSDataset().trashEnabled(blockPoolId)); BlockPoolSliceStorage bps = dn0.getStorage().getBPStorage(blockPoolId); assertFalse(bps.trashEnabled()); }