case LAUNCH_GROUP: { Protos.ExecutorInfo executor = operation.getLaunchGroup().getExecutor(); executorsById.put(executor.getExecutorId().getValue(), executor);
.getExecutor() .toBuilder() .setExecutorId(Protos.ExecutorID.newBuilder().setValue("")) .build(); logger.info("Using new executor derived from task {}: {}",
public static boolean isRunningExecutor(PodInfoBuilder podInfoBuilder, Protos.Offer offer) { if (!podInfoBuilder.getExecutorBuilder().isPresent()) { return false; } for (Protos.ExecutorID execId : offer.getExecutorIdsList()) { if (execId.equals(podInfoBuilder.getExecutorBuilder().get().getExecutorId())) { return true; } } return false; } }
.setExecutorId(ExecutorID.newBuilder().setValue( "executor_" + taskId.getValue())) .setName("Hadoop TaskTracker")
.setValue(frameworkId)) .setName(name) .setExecutorId(Protos.ExecutorID.newBuilder().setValue("")) .setCommand(createCommandInfo(command, arguments,
.newBuilder() .setExecutorId( ExecutorID.newBuilder().setValue( "executor_" + taskId.getValue())) .setName("Hama Groom Server").setSource(taskId.getValue())
.setExecutorId(ExecutorID.newBuilder() .setValue(id) .build())
String executorIdString = executorInfo.getExecutorId().getValue(); Optional<Protos.ExecutorID> executorID = executorIdString.isEmpty() ? Optional.empty() :
.build(), Protos.ExecutorInfo.newBuilder().setExecutorId( Protos.ExecutorID.newBuilder().setValue("executor")).build()); .build(), Protos.ExecutorInfo.newBuilder().setExecutorId( Protos.ExecutorID.newBuilder().setValue("executor")).build());
if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId());
.setExecutorId(ExecutorID.newBuilder().setValue(details.getId())) .setData(ByteString.copyFromUtf8(executorDataStr)) .addAllResources(executorResources);
public Map<String, Map<String, Map<String, Object>>> updateYaml(Map<String, Map<String, Map<String, Object>>> yamlMap, TaskInfo taskInfo, ExecutorInfo executorInfo) { log.debug(" ############ STARTING updateYaml ################"); if (yamlMap == null || yamlMap.isEmpty()) { return null; } Map<String, Map<String, Map<String, Object>>> resultantContainerMap = new HashMap<String, Map<String, Map<String, Object>>>(); resultantContainerMap.putAll(yamlMap); String taskId = taskInfo.getTaskId().getValue(); Iterator<Long> portIterator = getPortMappingIterator(taskInfo); String executorId = executorInfo.getExecutorId().getValue(); log.debug(" executorId: " + executorId); Map<String, Map<String, Object>> services = yamlMap.get(SERVICES); log.debug(" services map: " + services.toString()); Map<String, Map<String, Object>> resultantServicesMap = new HashMap<String, Map<String, Object>>(); for (Map.Entry<String, Map<String, Object>> containerEntry : services.entrySet()) { String key = containerEntry.getKey(); Map<String, Object> containerValue = containerEntry.getValue(); Map<String, Object> updatedContainerValues = updateContainerValue(executorId, taskInfo, containerValue, portIterator); String updatedKey = prefixTaskId(taskId, key); resultantServicesMap.put(updatedKey, updatedContainerValues); } resultantContainerMap.put(SERVICES, resultantServicesMap); return resultantContainerMap; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.scheduler.Protos.Event.Failure)) { return super.equals(obj); } org.apache.mesos.scheduler.Protos.Event.Failure other = (org.apache.mesos.scheduler.Protos.Event.Failure) obj; boolean result = true; result = result && (hasSlaveId() == other.hasSlaveId()); if (hasSlaveId()) { result = result && getSlaveId() .equals(other.getSlaveId()); } result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasStatus() == other.hasStatus()); if (hasStatus()) { result = result && (getStatus() == other.getStatus()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <pre> * If this was just a failure of an executor on a slave then * 'executor_id' will be set and possibly 'status' (if we were * able to determine the exit status). * </pre> * * <code>optional .mesos.ExecutorID executor_id = 2;</code> */ public Builder mergeExecutorId(org.apache.mesos.Protos.ExecutorID value) { if (executorIdBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && executorId_ != null && executorId_ != org.apache.mesos.Protos.ExecutorID.getDefaultInstance()) { executorId_ = org.apache.mesos.Protos.ExecutorID.newBuilder(executorId_).mergeFrom(value).buildPartial(); } else { executorId_ = value; } onChanged(); } else { executorIdBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.scheduler.Protos.Event.Message)) { return super.equals(obj); } org.apache.mesos.scheduler.Protos.Event.Message other = (org.apache.mesos.scheduler.Protos.Event.Message) obj; boolean result = true; result = result && (hasSlaveId() == other.hasSlaveId()); if (hasSlaveId()) { result = result && getSlaveId() .equals(other.getSlaveId()); } result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasData() == other.hasData()); if (hasData()) { result = result && getData() .equals(other.getData()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.scheduler.Protos.Call.Message)) { return super.equals(obj); } org.apache.mesos.scheduler.Protos.Call.Message other = (org.apache.mesos.scheduler.Protos.Call.Message) obj; boolean result = true; result = result && (hasSlaveId() == other.hasSlaveId()); if (hasSlaveId()) { result = result && getSlaveId() .equals(other.getSlaveId()); } result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasData() == other.hasData()); if (hasData()) { result = result && getData() .equals(other.getData()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.mesos.scheduler.Protos.Call.Shutdown)) { return super.equals(obj); } org.apache.mesos.scheduler.Protos.Call.Shutdown other = (org.apache.mesos.scheduler.Protos.Call.Shutdown) obj; boolean result = true; result = result && (hasExecutorId() == other.hasExecutorId()); if (hasExecutorId()) { result = result && getExecutorId() .equals(other.getExecutorId()); } result = result && (hasSlaveId() == other.hasSlaveId()); if (hasSlaveId()) { result = result && getSlaveId() .equals(other.getSlaveId()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <pre> * Identifies the executor which generated this call. * </pre> * * <code>required .mesos.ExecutorID executor_id = 1;</code> */ public Builder mergeExecutorId(org.apache.mesos.Protos.ExecutorID value) { if (executorIdBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && executorId_ != null && executorId_ != org.apache.mesos.Protos.ExecutorID.getDefaultInstance()) { executorId_ = org.apache.mesos.Protos.ExecutorID.newBuilder(executorId_).mergeFrom(value).buildPartial(); } else { executorId_ = value; } onChanged(); } else { executorIdBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
@Test public void testExecutorStateMechanism() throws IOException, InterruptedException, ExecutionException, ClassNotFoundException { Protos.TaskStatus taskStatus = Protos.TaskStatus.getDefaultInstance(); SerializableState state = Mockito.mock(SerializableState.class); when(state.get(anyString())).thenReturn(taskStatus); Protos.FrameworkID frameworkID = Protos.FrameworkID.newBuilder().setValue(FRAMEWORK_ID).build(); Protos.SlaveID slaveID = Protos.SlaveID.newBuilder().setValue(SLAVE_ID).build(); Protos.ExecutorID executorID = Protos.ExecutorID.newBuilder().setValue(EXECUTOR_ID).build(); Protos.TaskID taskID = Protos.TaskID.newBuilder().setValue(TASK_ID).build(); Protos.TaskInfo taskInfo = Protos.TaskInfo.newBuilder() .setTaskId(taskID) .setExecutor(Protos.ExecutorInfo.newBuilder() .setExecutorId(executorID) .setCommand(Protos.CommandInfo.getDefaultInstance()) ) .setSlaveId(slaveID) .setName("Test") .build(); ESTaskStatus executorState = new ESTaskStatus(state, frameworkID, taskInfo, mock(StatePath.class)); executorState.setStatus(taskStatus); verify(state, times(1)).set(anyString(), any(Protos.TaskStatus.class)); Protos.TaskStatus newStatus = executorState.getStatus(); assertNotNull(newStatus); assertEquals(taskStatus.getExecutorId().toString(), newStatus.getExecutorId().toString()); } }