code: public synchronized boolean startUpgrade() throws IOException {
      if(upgradeState) {  // upgrade is already in progress
        assert currentUpgrades != null : 
          "UpgradeManagerDatanode.currentUpgrades is null.";
        UpgradeObjectDatanode curUO = (UpgradeObjectDatanode)currentUpgrades.first();
        curUO.startUpgrade();
        return true;
      }
      if(broadcastCommand != null) {
        if(broadcastCommand.getVersion() > this.getUpgradeVersion()) {
          // stop broadcasting, the cluster moved on
          // start upgrade for the next version
          broadcastCommand = null;
        } else {
          // the upgrade has been finished by this data-node,
          // but the cluster is still running it, 
          // reply with the broadcast command
          assert currentUpgrades == null : 
            "UpgradeManagerDatanode.currentUpgrades is not null.";
          assert upgradeDaemon == null : 
            "UpgradeManagerDatanode.upgradeDaemon is not null.";
          dataNode.getNSNamenode(namespaceId).processUpgradeCommand(broadcastCommand);
          return true;
        }
      }
      if(currentUpgrades == null)
        currentUpgrades = getDistributedUpgrades();
      if(currentUpgrades == null) {
        DataNode.LOG.info("\n   Distributed upgrade for DataNode version " 
            + getUpgradeVersion() + " to current LV " 
            + FSConstants.LAYOUT_VERSION + " cannot be started. "
            + "The upgrade object is not defined.");
        return false;
      }
      upgradeState = true;
      UpgradeObjectDatanode curUO = (UpgradeObjectDatanode)currentUpgrades.first();
      curUO.setDatanode(dataNode);
      curUO.startUpgrade();
      upgradeDaemon = new Daemon(curUO);
      upgradeDaemon.start();
      DataNode.LOG.info("\n   Distributed upgrade for DataNode " 
          + dataNode.getDatanodeInfo() 
          + " version " + getUpgradeVersion() + " to current LV " 
          + FSConstants.LAYOUT_VERSION + " is started.");
      return true;
    }
docs: Start distributed upgrade.
  Instantiates distributed upgrade objects.
  
  @return true if distributed upgrade is required or false otherwise
  @throws IOException