class TensorFlowLaunchCommand extends AbstractLaunchCommand {

  @Override
  public String generateLaunchScript() throws IOException {
    LaunchScriptBuilder builder = getBuilder();

    // When distributed training is required
    if (distributed) {
      String tfConfigEnvValue = TensorFlowConfigEnvGenerator.getTFConfigEnv(
          role.getComponentName(), numberOfWorkers,
          numberOfPS, name,
          TensorFlowCommons.getUserName(),
          TensorFlowCommons.getDNSDomain(yarnConfig));
      String tfConfig = "export TF_CONFIG=\"" + tfConfigEnvValue + "\"\n";
      builder.append(tfConfig);
    }

    return builder
        .withLaunchCommand(createLaunchCommand())
        .build();
  }

    TensorFlowLaunchCommand(HadoopEnvironmentSetup hadoopEnvSetup,
                          Role role, Component component,
                          TensorFlowRunJobParameters parameters,
                          Configuration yarnConfig);

}