.append(" ") .append(ContainerSpecification.formatSystemProperties(dynamicProperties)); cmd.setValue(launchCommand.toString());
licenceFile = fileName(clusterProps.licenceUrl()); builder.setValue( (licenceFile != null ? "find . -maxdepth 1 -name \"" + licenceFile + "\" -exec cp {} ./*/ \\; && " : "") + "find . -maxdepth 1 -name \"*.jar\" -exec cp {} ./*/libs/ \\; && "
private Protos.CommandInfo buildCommand(final Protos.CommandInfo.URI uri, final String script, final ShardingContexts shardingContexts, final boolean isCommandExecutor) { Protos.CommandInfo.Builder result = Protos.CommandInfo.newBuilder().addUris(uri).setShell(true); if (isCommandExecutor) { CommandLine commandLine = CommandLine.parse(script); commandLine.addArgument(GsonFactory.getGson().toJson(shardingContexts), false); result.setValue(Joiner.on(" ").join(commandLine.getExecutable(), Joiner.on(" ").join(commandLine.getArguments()))); } else { result.setValue(script); } return result.build(); }
commandInfo .setEnvironment(envBuilder) .setValue(String.format("cd %s && %s", directory, command)); if (uri != null) { commandInfo.addUris(CommandInfo.URI.newBuilder().setValue(uri));
public static final double MEM = 1000.0; public static final double DISK = 2000.0; public static final Protos.CommandInfo CMD = Protos.CommandInfo.newBuilder().setValue("echo test-cmd").build();
.setValue(String.format("cd %s && %s", directory, command)) .addUris(CommandInfo.URI.newBuilder().setValue(uri)).build();
.addUris(URI.newBuilder().setValue((String) mesosStormConf.get(CONF_EXECUTOR_URI))) .addUris(URI.newBuilder().setValue(configUri)) .setValue(logviewerCommand);
executorInfoBuilder.setCommand(CommandInfo.newBuilder() .addUris(URI.newBuilder().setValue(configUri)) .setValue(commandLineShim.getCommandLine(details.getId()))) .setContainer(ContainerInfo.newBuilder() .setType(ContainerInfo.Type.DOCKER) .addUris(URI.newBuilder().setValue((String) mesosStormConf.get(CONF_EXECUTOR_URI))) .addUris(URI.newBuilder().setValue(configUri)) .setValue(commandLineShim.getCommandLine(details.getId())));
CommandInfo .newBuilder() .setValue(cmd)).build();
.setValue(healthCheckSpec.getCommand()) .setEnvironment(EnvUtils.toProto(getTaskEnvironment(serviceName, podInstance,
private void setReadinessCheck( Protos.TaskInfo.Builder taskInfoBuilder, String serviceName, PodInstance podInstance, TaskSpec taskSpec, GoalStateOverride override, SchedulerConfig schedulerConfig) { Optional<ReadinessCheckSpec> readinessCheckSpecOptional = getReadinessCheck(taskSpec, override); if (!readinessCheckSpecOptional.isPresent()) { LOGGER.debug("No readiness check defined for taskSpec: {}", taskSpec.getName()); return; } ReadinessCheckSpec readinessCheckSpec = readinessCheckSpecOptional.get(); // Default executor supports the newer TaskInfo.check field: Protos.CheckInfo.Builder builder = taskInfoBuilder.getCheckBuilder() .setType(Protos.CheckInfo.Type.COMMAND) .setDelaySeconds(readinessCheckSpec.getDelay()) .setIntervalSeconds(readinessCheckSpec.getInterval()) .setTimeoutSeconds(readinessCheckSpec.getTimeout()); builder.getCommandBuilder().getCommandBuilder() .setValue(readinessCheckSpec.getCommand()) .setEnvironment(EnvUtils.toProto(getTaskEnvironment(serviceName, podInstance, taskSpec, schedulerConfig))); }
public static Protos.TaskInfo getDefaultTaskInfo() { return Protos.TaskInfo.newBuilder() .setName("dummyTaskName") .setTaskId(Protos.TaskID.newBuilder().setValue(SLAVE_ID)) .setSlaveId(getSlaveId()) .setExecutor(Protos.ExecutorInfo.newBuilder() .setExecutorId(getExecutorId()) .setCommand(Protos.CommandInfo.newBuilder().setValue("").build()) .build()) .setDiscovery( Protos.DiscoveryInfo.newBuilder() .setVisibility(Protos.DiscoveryInfo.Visibility.EXTERNAL) .setPorts(Protos.Ports.newBuilder() .addPorts(Discovery.CLIENT_PORT_INDEX, Protos.Port.newBuilder().setNumber(9200)) .addPorts(Discovery.TRANSPORT_PORT_INDEX, Protos.Port.newBuilder().setNumber(9300)) ) ) .build(); }
public static CommandInfo createCommandInfo( final String command, final List<String> arguments, final Set<String> uris, boolean cacheFetchedUris, final Map<String, String> environment) { return CommandInfo.newBuilder() .setValue(command) .addAllArguments(arguments) .addAllUris(createURIs(uris, cacheFetchedUris)) .setEnvironment(createEnvironment(environment)).build(); }
public static Protos.TaskInfo getTaskInfoExternalVolume(Integer esNodeId) { return Protos.TaskInfo.newBuilder(getDefaultTaskInfo()) .setCommand(Protos.CommandInfo.newBuilder() .setValue("") .setEnvironment(Protos.Environment.newBuilder() .addVariables(Protos.Environment.Variable.newBuilder() .setName(ExecutorEnvironmentalVariables.ELASTICSEARCH_NODE_ID) .setValue(esNodeId.toString()))) .build()) .build(); }