code: private int restartTaskTracker(boolean forceFlag, int batchSize) throws IOException {
      // Get the current configuration
      CoronaConf conf = new CoronaConf(getConf());
  
      InetSocketAddress address = NetUtils.createSocketAddr(conf
          .getClusterManagerAddress());
      TFramedTransport transport = new TFramedTransport(
        new TSocket(address.getHostName(), address.getPort()));
      ClusterManagerService.Client client = new ClusterManagerService.Client(
          new TBinaryProtocol(transport));
      int restartBatch = (batchSize > 0) ? batchSize :
        conf.getCoronaNodeRestartBatch();
  
      try {
        transport.open();
        RestartNodesArgs restartNodeArgs = new RestartNodesArgs(
          forceFlag, restartBatch);
        client.restartNodes(restartNodeArgs);
      } catch (SafeModeException e) {
        System.err.println("ClusterManager is in Safe Mode");
      } catch (TException e) {
        throw new IOException(e);
      }
  
      return 0;
    }
docs: Command to ask the Cluster Manager to restart all the task tracker
  
  @param forceFlag if CM shall ignore all previous restart requests
  @exception IOException
  @return Returns 0 where no exception is thrown.