code: private int forceSetSafeModeOnPJT(boolean safeMode) throws IOException {
      CoronaConf conf = new CoronaConf(getConf());
      try {
        ClusterManagerAvailabilityChecker.getPJTClient(conf).
          setClusterManagerSafeModeFlag(safeMode);
      } catch (IOException e) {
        System.err.println("Could not set the Safe Mode flag on the PJT: " + e);
      } catch (TException e) {
        System.err.println("Could not set the Safe Mode flag on the PJT: " + e);
      }
      return 0;
    }
docs: Forcefully set the Safe Mode on the PJT
  @return 0 if successful
  @throws IOException