UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { boolean isFinalized = false; if(currentUpgrades == null) { // no upgrades are in progress FSImage fsimage = namesystem.getFSImage(); isFinalized = fsimage.isUpgradeFinalized(); if(isFinalized) // upgrade is finalized return null; // nothing to report return new UpgradeStatusReport(fsimage.getLayoutVersion(), (short)101, isFinalized); } UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first(); boolean details = false; switch(action) { case GET_STATUS: break; case DETAILED_STATUS: details = true; break; case FORCE_PROCEED: curUO.forceProceed(); } return curUO.getUpgradeStatusReport(details); }
UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { boolean isFinalized = false; if(currentUpgrades == null) { // no upgrades are in progress FSImage fsimage = FSNamesystem.getFSNamesystem().getFSImage(); isFinalized = fsimage.isUpgradeFinalized(); if(isFinalized) // upgrade is finalized return null; // nothing to report return new UpgradeStatusReport(fsimage.getLayoutVersion(), (short)101, isFinalized); } UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first(); boolean details = false; switch(action) { case GET_STATUS: break; case DETAILED_STATUS: details = true; break; case FORCE_PROCEED: curUO.forceProceed(); } return curUO.getUpgradeStatusReport(details); }
synchronized UpgradeStatusReport distributedUpgradeProgress (UpgradeAction action) throws IOException { boolean isFinalized = false; if(currentUpgrades == null) { // no upgrades are in progress FSImage fsimage = namesystem.getFSImage(); isFinalized = fsimage.isUpgradeFinalized(); if(isFinalized) // upgrade is finalized return null; // nothing to report return new UpgradeStatusReport(fsimage.getLayoutVersion(), (short)101, isFinalized); } UpgradeObjectNamenode curUO = (UpgradeObjectNamenode)currentUpgrades.first(); boolean details = false; switch(action) { case GET_STATUS: break; case DETAILED_STATUS: details = true; break; case FORCE_PROCEED: curUO.forceProceed(); } return curUO.getUpgradeStatusReport(details); }
@Override public UpgradeStatusReport distributedUpgradeProgress( final UpgradeAction action) throws IOException { return (failoverHandler.new MutableFSCaller<UpgradeStatusReport>() { public UpgradeStatusReport call(int r) throws IOException { return namenode.distributedUpgradeProgress(action); } }).callFS(); }
public String getUpgradeStatusText() { String statusText = ""; try { UpgradeStatusReport status = fsn.distributedUpgradeProgress(UpgradeAction.GET_STATUS); statusText = (status == null ? "There are no upgrades in progress." : status.getStatusText(false)); } catch(IOException e) { statusText = "Upgrade status unknown."; } return statusText; }
/** * Command to request current distributed upgrade status, * a detailed status, or to force the upgrade to proceed. * * Usage: java DFSAdmin -upgradeProgress [status | details | force] * @exception IOException */ public int upgradeProgress(String[] argv, int idx) throws IOException { DistributedFileSystem dfs = getDFS(); if (dfs == null) { System.out.println("FileSystem is " + getFS().getUri()); return -1; } if (idx != argv.length - 1) { printUsage("-upgradeProgress"); return -1; } UpgradeAction action; if ("status".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.GET_STATUS; } else if ("details".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.DETAILED_STATUS; } else if ("force".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.FORCE_PROCEED; } else { printUsage("-upgradeProgress"); return -1; } UpgradeStatusReport status = dfs.distributedUpgradeProgress(action); String statusText = (status == null ? "There are no upgrades in progress." : status.getStatusText(action == UpgradeAction.DETAILED_STATUS)); System.out.println(statusText); return 0; }
/** * Command to request current distributed upgrade status, * a detailed status, or to force the upgrade to proceed. * * Usage: java DFSAdmin -upgradeProgress [status | details | force] * @exception IOException */ public int upgradeProgress(String[] argv, int idx) throws IOException { if (!(fs instanceof DistributedFileSystem)) { System.out.println("FileSystem is " + fs.getUri()); return -1; } if (idx != argv.length - 1) { printUsage("-upgradeProgress"); return -1; } UpgradeAction action; if ("status".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.GET_STATUS; } else if ("details".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.DETAILED_STATUS; } else if ("force".equalsIgnoreCase(argv[idx])) { action = UpgradeAction.FORCE_PROCEED; } else { printUsage("-upgradeProgress"); return -1; } DistributedFileSystem dfs = (DistributedFileSystem) fs; UpgradeStatusReport status = dfs.distributedUpgradeProgress(action); String statusText = (status == null ? "There are no upgrades in progress." : status.getStatusText(action == UpgradeAction.DETAILED_STATUS)); System.out.println(statusText); return 0; }
static String getUpgradeStatusText(FSNamesystem fsn) { String statusText = ""; try { UpgradeStatusReport status = fsn .distributedUpgradeProgress(UpgradeAction.GET_STATUS); statusText = (status == null ? "There are no upgrades in progress." : status.getStatusText(false)); } catch (IOException e) { statusText = "Upgrade status unknown."; } return statusText; }
@Override public UpgradeStatusReport distributedUpgradeProgress( final UpgradeAction action) throws IOException { return (new MutableFSCaller<UpgradeStatusReport>() { UpgradeStatusReport call(int r) throws IOException { return namenode.distributedUpgradeProgress(action); } }).callFS(); }
/** * @see ClientProtocol#distributedUpgradeProgress(FSConstants.UpgradeAction) */ public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { return namenode.distributedUpgradeProgress(action); }
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { return dfs.distributedUpgradeProgress(action); }
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { return namesystem.distributedUpgradeProgress(action); }
UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { return upgradeManager.distributedUpgradeProgress(action); }
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action ) throws IOException { return getDFS().distributedUpgradeProgress(action); }
/** * @see ClientProtocol#distributedUpgradeProgress(FSConstants.UpgradeAction) */ public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action) throws IOException { return namenode.distributedUpgradeProgress(action); }
public UpgradeStatusReport distributedUpgradeProgress(UpgradeAction action) throws IOException { return namesystem.distributedUpgradeProgress(action); }