private SimpleSlot createSimpleSlot(AllocatedSlot slot, Locality locality) { SimpleSlot result = new SimpleSlot(slot, providerAndOwner, slot.getSlotNumber()); if (locality != null) { result.setLocality(locality); } return result; }
/** * */ SimpleSlot getSlotForTask(JobVertexID vertexID, Iterable<TaskManagerLocation> locationPreferences) { synchronized (lock) { Tuple2<SharedSlot, Locality> p = getSlotForTaskInternal(vertexID, locationPreferences, false); if (p != null) { SharedSlot ss = p.f0; SimpleSlot slot = ss.allocateSubSlot(vertexID); slot.setLocality(p.f1); return slot; } else { return null; } } }
/** * Gets a slot suitable for the given task vertex. This method will prefer slots that are local * (with respect to {@link ExecutionVertex#getPreferredLocationsBasedOnInputs()}), but will return non local * slots if no local slot is available. The method returns null, when this sharing group has * no slot is available for the given JobVertexID. * * @param vertexID the vertex id * @param locationPreferences location preferences * * @return A slot to execute the given ExecutionVertex in, or null, if none is available. */ public SimpleSlot getSlotForTask(JobVertexID vertexID, Iterable<TaskManagerLocation> locationPreferences) { synchronized (lock) { Tuple2<SharedSlot, Locality> p = getSharedSlotForTask(vertexID, locationPreferences, false); if (p != null) { SharedSlot ss = p.f0; SimpleSlot slot = ss.allocateSubSlot(vertexID); slot.setLocality(p.f1); return slot; } else { return null; } } }
/** * Gets a slot suitable for the given task vertex. This method will prefer slots that are local * (with respect to {@link ExecutionVertex#getPreferredLocationsBasedOnInputs()}), but will return non local * slots if no local slot is available. The method returns null, when this sharing group has * no slot is available for the given JobVertexID. * * @param vertexID the vertex id * @param locationPreferences location preferences * * @return A slot to execute the given ExecutionVertex in, or null, if none is available. */ public SimpleSlot getSlotForTask(JobVertexID vertexID, Iterable<TaskManagerLocation> locationPreferences) { synchronized (lock) { Tuple2<SharedSlot, Locality> p = getSharedSlotForTask(vertexID, locationPreferences, false); if (p != null) { SharedSlot ss = p.f0; SimpleSlot slot = ss.allocateSubSlot(vertexID); slot.setLocality(p.f1); return slot; } else { return null; } } }
/** * Gets a slot suitable for the given task vertex. This method will prefer slots that are local * (with respect to {@link ExecutionVertex#getPreferredLocationsBasedOnInputs()}), but will return non local * slots if no local slot is available. The method returns null, when this sharing group has * no slot is available for the given JobVertexID. * * @param vertexID the vertex id * @param locationPreferences location preferences * * @return A slot to execute the given ExecutionVertex in, or null, if none is available. */ public SimpleSlot getSlotForTask(JobVertexID vertexID, Iterable<TaskManagerLocation> locationPreferences) { synchronized (lock) { Tuple2<SharedSlot, Locality> p = getSharedSlotForTask(vertexID, locationPreferences, false); if (p != null) { SharedSlot ss = p.f0; SimpleSlot slot = ss.allocateSubSlot(vertexID); slot.setLocality(p.f1); return slot; } else { return null; } } }
slot.setLocality(locality); return slot;
slot.setLocality(locality); return slot;
slot.setLocality(locality); return slot;
slot.setLocality(locality); return slot;
subSlot.setLocality(locality);
subSlot.setLocality(locality);
subSlot.setLocality(locality);
subSlot.setLocality(locality);
subslot.setLocality(Locality.LOCAL); return subslot; subSlot.setLocality(Locality.LOCAL); return subSlot; sub.setLocality(l); return sub;
subslot.setLocality(Locality.LOCAL); return subslot; subSlot.setLocality(Locality.LOCAL); return subSlot; sub.setLocality(l); return sub;
subslot.setLocality(Locality.LOCAL); return subslot; subSlot.setLocality(Locality.LOCAL); return subSlot; sub.setLocality(l); return sub;
subslot.setLocality(Locality.LOCAL); return subslot; subSlot.setLocality(Locality.LOCAL); return subSlot; sub.setLocality(l); return sub;