.setExecutorId(ExecutorID.newBuilder().setValue(task.getDeploy().getCustomExecutorId().or(idGenerator.getNextExecutorId())))
protected SingularityTask prepTask(SingularityRequest request, SingularityDeploy deploy, long launchTime, int instanceNo, boolean separateHosts, Optional<String> runId) { SingularityPendingTask pendingTask = buildPendingTask(request, deploy, launchTime, instanceNo, runId); SingularityTaskRequest taskRequest = new SingularityTaskRequest(request, deploy, pendingTask); Offer offer; if (separateHosts) { offer = createOffer(125, 1024, 2048, String.format("slave%s", instanceNo), String.format("host%s", instanceNo)); } else { offer = createOffer(125, 1024, 2048); } SingularityTaskId taskId = new SingularityTaskId(request.getId(), deploy.getId(), launchTime, instanceNo, offer.getHostname(), "rack1"); TaskID taskIdProto = TaskID.newBuilder().setValue(taskId.toString()).build(); TaskInfo taskInfo = TaskInfo.newBuilder() .setAgentId(offer.getAgentId()) .setExecutor(ExecutorInfo.newBuilder().setExecutorId(ExecutorID.newBuilder().setValue("executorID"))) .setTaskId(taskIdProto) .setName("name") .build(); SingularityTask task = new SingularityTask(taskRequest, taskId, Collections.singletonList(mesosProtosUtils.offerFromProtos(offer)), mesosProtosUtils.taskFromProtos(taskInfo), Optional.of("rack1")); taskManager.savePendingTask(pendingTask); return task; }
return update( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), org.apache.mesos.v1.Protos.TaskID.newBuilder().setValue(taskId).build(), state,
.setExecutorId(ExecutorID.newBuilder().setValue(task.getDeploy().getCustomExecutorId().or(idGenerator.getNextExecutorId())))
return update( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), org.apache.mesos.v1.Protos.TaskID.newBuilder().setValue(taskId).build(), state,
/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type * {@link Protos.Event.Type#MESSAGE MESSAGE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.AgentID#getValue() value} of the * {@link Protos.Event.Message#getAgentId() agentId} to be set on the * {@link Protos.Event.Message Message}. * @param executorId The {@link org.apache.mesos.v1.Protos.ExecutorID#getValue() value} of the * {@link Protos.Event.Message#getExecutorId() executorId} to be set on the * {@link Protos.Event.Message Message}. * @param data The {@link Protos.Event.Message#getData() data} to be set on the * {@link Protos.Event.Message Message}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge Acknowledge}. */ @NotNull public static Protos.Event message( @NotNull final String agentId, @NotNull final String executorId, @NotNull final ByteString data ) { return message( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), data ); }
/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type * {@link Protos.Event.Type#MESSAGE MESSAGE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.AgentID#getValue() value} of the * {@link Protos.Event.Message#getAgentId() agentId} to be set on the * {@link Protos.Event.Message Message}. * @param executorId The {@link org.apache.mesos.v1.Protos.ExecutorID#getValue() value} of the * {@link Protos.Event.Message#getExecutorId() executorId} to be set on the * {@link Protos.Event.Message Message}. * @param data The {@link Protos.Event.Message#getData() data} to be set on the * {@link Protos.Event.Message Message}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge Acknowledge}. */ @NotNull public static Protos.Event message( @NotNull final String agentId, @NotNull final String executorId, @NotNull final ByteString data ) { return message( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), data ); }
protected SingularityTask prepTask(SingularityRequest request, SingularityDeploy deploy, long launchTime, int instanceNo, boolean separateHosts, Optional<String> runId) { SingularityPendingTask pendingTask = buildPendingTask(request, deploy, launchTime, instanceNo, runId); SingularityTaskRequest taskRequest = new SingularityTaskRequest(request, deploy, pendingTask); Offer offer; if (separateHosts) { offer = createOffer(125, 1024, 2048, String.format("slave%s", instanceNo), String.format("host%s", instanceNo)); } else { offer = createOffer(125, 1024, 2048); } SingularityTaskId taskId = new SingularityTaskId(request.getId(), deploy.getId(), launchTime, instanceNo, offer.getHostname(), "rack1"); TaskID taskIdProto = TaskID.newBuilder().setValue(taskId.toString()).build(); TaskInfo taskInfo = TaskInfo.newBuilder() .setAgentId(offer.getAgentId()) .setExecutor(ExecutorInfo.newBuilder().setExecutorId(ExecutorID.newBuilder().setValue("executorID"))) .setTaskId(taskIdProto) .setName("name") .build(); SingularityTask task = new SingularityTask(taskRequest, taskId, Collections.singletonList(mesosProtosUtils.offerFromProtos(offer)), mesosProtosUtils.taskFromProtos(taskInfo), Optional.of("rack1")); taskManager.savePendingTask(pendingTask); return task; }
public static ExecutorID toExecutorId(MesosStringValue stringValue) { return ExecutorID.newBuilder().setValue(stringValue.getValue()).build(); }
public static ExecutorID toExecutorId(MesosStringValue stringValue) { return ExecutorID.newBuilder().setValue(stringValue.getValue()).build(); }