Examples of CommandLineBuilder


Examples of org.apache.slider.core.launch.CommandLineBuilder

    //now add the image if it was set
    String imageURI = instanceDefinition.getInternalOperations()
                                        .get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
    fileSystem.maybeAddImagePath(launcher.getLocalResources(), imageURI);

    CommandLineBuilder commandLine = new CommandLineBuilder();
   
    String heap = "-Xmx" + appComponent.getOption(RoleKeys.JVM_HEAP, DEFAULT_JVM_HEAP);
    String opt = "ACCUMULO_OTHER_OPTS";
    if (SliderUtils.isSet(heap)) {
      switch (role) {
        case AccumuloKeys.ROLE_MASTER:
          opt = "ACCUMULO_MASTER_OPTS";
          break;
        case AccumuloKeys.ROLE_TABLET:
          opt = "ACCUMULO_TSERVER_OPTS";
          break;
        case AccumuloKeys.ROLE_MONITOR:
          opt = "ACCUMULO_MONITOR_OPTS";
          break;
        case AccumuloKeys.ROLE_GARBAGE_COLLECTOR:
          opt = "ACCUMULO_GC_OPTS";
          break;
      }
      launcher.setEnv(opt, heap);
    }

    //this must stay relative if it is an image
    commandLine.add(providerUtils.buildPathToScript(instanceDefinition,
      "bin", "accumulo"));

    //role is translated to the accumulo one
    commandLine.add(AccumuloRoles.serviceForRole(role));
   
    // Add any role specific arguments to the command line
    String additionalArgs = ProviderUtils.getAdditionalArgs(appComponent);
    if (!StringUtils.isBlank(additionalArgs)) {
      commandLine.add(additionalArgs);
    }

    commandLine.addOutAndErrFiles(role + "-out.txt", role + "-err.txt");


    launcher.addCommand(commandLine.build());
  }
View Full Code Here

Examples of org.apache.slider.core.launch.CommandLineBuilder

    //now add the image if it was set
    String imageURI = instanceDefinition.getInternalOperations()
                  .get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
    coreFS.maybeAddImagePath(launcher.getLocalResources(), imageURI);

    CommandLineBuilder cli = new CommandLineBuilder();

    String heap = appComponent.getOption(RoleKeys.JVM_HEAP, DEFAULT_JVM_HEAP);
    if (SliderUtils.isSet(heap)) {
      String adjustedHeap = SliderUtils.translateTrailingHeapUnit(heap);
      launcher.setEnv(HBASE_HEAPSIZE, adjustedHeap);
    }
   
    String gcOpts = appComponent.getOption(RoleKeys.GC_OPTS, DEFAULT_GC_OPTS);
    if (SliderUtils.isSet(gcOpts)) {
      launcher.setEnv(HBASE_GC_OPTS, gcOpts);
    }
   
    //this must stay relative if it is an image
    cli.add(providerUtils.buildPathToScript(
        instanceDefinition,
        "bin",
        HBASE_SCRIPT));
    //config dir is relative to the generated file
    cli.add(ARG_CONFIG);
    cli.add("$PROPAGATED_CONFDIR");

    String roleCommand;
    String logfile;
    //now look at the role
    switch (role) {
      case ROLE_WORKER:
        //role is region server
        roleCommand = REGION_SERVER;
        logfile = "/region-server.txt";
        break;
      case ROLE_MASTER:
        roleCommand = MASTER;

        logfile = "/master.txt";
        break;
      default:
        throw new SliderInternalStateException("Cannot start role %s", role);
    }

    cli.add(roleCommand);
    cli.add(ACTION_START);
    //log details
    cli.addOutAndErrFiles(logfile, null);
    launcher.addCommand(cli.build());

  }
View Full Code Here

Examples of org.apache.slider.core.launch.CommandLineBuilder

    //now add the image if it was set
    String imageURI = instanceDefinition.getInternalOperations()
                                        .get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
    fileSystem.maybeAddImagePath(launcher.getLocalResources(), imageURI);

    CommandLineBuilder commandLine = new CommandLineBuilder();
   
    String heap = "-Xmx" + appComponent.getOption(RoleKeys.JVM_HEAP, DEFAULT_JVM_HEAP);
    String opt = "ACCUMULO_OTHER_OPTS";
    if (SliderUtils.isSet(heap)) {
      switch (role) {
        case AccumuloKeys.ROLE_MASTER:
          opt = "ACCUMULO_MASTER_OPTS";
          break;
        case AccumuloKeys.ROLE_TABLET:
          opt = "ACCUMULO_TSERVER_OPTS";
          break;
        case AccumuloKeys.ROLE_MONITOR:
          opt = "ACCUMULO_MONITOR_OPTS";
          break;
        case AccumuloKeys.ROLE_GARBAGE_COLLECTOR:
          opt = "ACCUMULO_GC_OPTS";
          break;
      }
      launcher.setEnv(opt, heap);
    }

    //this must stay relative if it is an image
    commandLine.add(providerUtils.buildPathToScript(instanceDefinition,
      "bin", "accumulo"));

    //role is translated to the accumulo one
    commandLine.add(AccumuloRoles.serviceForRole(role));
   
    // Add any role specific arguments to the command line
    String additionalArgs = ProviderUtils.getAdditionalArgs(appComponent);
    if (!StringUtils.isBlank(additionalArgs)) {
      commandLine.add(additionalArgs);
    }

    commandLine.addOutAndErrFiles(role + "-out.txt", role + "-err.txt");


    launcher.addCommand(commandLine.build());
  }
View Full Code Here

Examples of org.apache.slider.core.launch.CommandLineBuilder

          LocalResourceType.FILE);
      launcher.addLocalResource(AgentKeys.AGENT_VERSION_FILE, agentVerRes);
    }

    String label = getContainerLabel(container, role);
    CommandLineBuilder operation = new CommandLineBuilder();

    operation.add(AgentKeys.PYTHON_EXE);

    operation.add(scriptPath);
    operation.add(ARG_LABEL, label);
    operation.add(ARG_HOST);
    operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_HOSTNAME));
    operation.add(ARG_PORT);
    operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_AGENT_PORT));
    operation.add(ARG_SECURED_PORT);
    operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_SECURED_AGENT_PORT));

    String debugCmd = agentLaunchParameter.getNextLaunchParameter(role);
    if (debugCmd != null && debugCmd.length() != 0) {
      operation.add(ARG_DEBUG);
      operation.add(debugCmd);
    }

    launcher.addCommand(operation.build());

    // initialize the component instance state
    componentStatuses.put(label,
                          new ComponentInstanceState(
                              role,
View Full Code Here

Examples of org.bioinfo.ngs.qc.qualimap.common.CommandLineBuilder

        return yes ? "yes\n" : "no\n";
    }

    public String getQualimapCmdLine(boolean  drawChromosomeLimits) {

            CommandLineBuilder cmdBuilder = new CommandLineBuilder("qualimap " + Constants.TOOL_NAME_BAMQC);

            cmdBuilder.append(Constants.BAMQC_OPTION_BAM_FILE, bamFile);

            if (featureFile != null) {
                cmdBuilder.append(Constants.BAMQC_OPTION_GFF_FILE, featureFile);
                if (computeOutsideStats) {
                    cmdBuilder.append(Constants.BAMQC_OPTION_OUTSIDE_STATS);
                }
            }

            if (drawChromosomeLimits) {
                cmdBuilder.append(Constants.BAMQC_OPTION_PAINT_CHROMOSOMES);
            }

            cmdBuilder.append(Constants.BAMQC_OPTION_NUM_WINDOWS, numberOfWindows);
            cmdBuilder.append(Constants.BAMQC_OPTION_MIN_HOMOPOLYMER_SIZE, minHomopolymerSize);

            return cmdBuilder.getCmdLine();

    }
View Full Code Here

Examples of org.jtestserver.client.utils.CommandLineBuilder

     * {@inheritDoc}
     * The implementation is launching {@code kvm} through a command line. 
     */
    @Override
    public boolean start(KVMConfig config) throws IOException {
        CommandLineBuilder cmdLine = createStartCommandLine(config);
        config.setVmName(cmdLine.toString());
        return runner.execute(cmdLine);
    }
View Full Code Here

Examples of org.jtestserver.client.utils.CommandLineBuilder

       
        return success;
    }
   
    private CommandLineBuilder createStartCommandLine(KVMConfig config) {
        CommandLineBuilder cmdLine = new CommandLineBuilder(KVM_COMMAND);
        cmdLine.append("-m").append(config.getMemory());
        cmdLine.append(OPTION_CDROM).append(config.getCdrom().getAbsolutePath());
        cmdLine.append(config.getOptions());
        cmdLine.append("-serial").append(config.getSerial());
        cmdLine.append("-k").append(config.getKeyboard());
        return cmdLine;
    }
View Full Code Here

Examples of org.jtestserver.client.utils.CommandLineBuilder

     */
    @Override
    public boolean start(JVMConfig config) throws IOException {       
        //runner.setWorkDir(new File(classesDir));
       
        CommandLineBuilder cmdLine = createStartCommandLine(config);
        config.setVmName(cmdLine.toString());
        return runner.execute(cmdLine);
    }
View Full Code Here

Examples of org.jtestserver.client.utils.CommandLineBuilder

        return success;
    }
   
    private CommandLineBuilder createStartCommandLine(JVMConfig config) {
        String java = new File(config.getJavaHome(), "bin/" + JAVA_COMMAND).getAbsolutePath();
        CommandLineBuilder cmdLine = new CommandLineBuilder(java);
       
        if (config.getBootClasspath() != null) {
            cmdLine.append("-Xbootclasspath").append(config.getBootClasspath());
        }

        if (config.getOptions() != null) {
            cmdLine.append(config.getOptions());
        }
       
        cmdLine.append("-D" + ConfigurationUtils.LOGGING_CONFIG_FILE + '='
                + ConfigurationUtils.getLoggingConfigFile());

        cmdLine.append("-cp").append(config.getClasspath());
        cmdLine.append(config.getMainClass());

        return cmdLine;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.