@Override public AllocationID getAllocationId() { return slotContext.getAllocationId(); }
@Override public AllocationID getAllocationId() { return slotContext.getAllocationId(); }
@Override public AllocationID getAllocationId() { return slotContext.getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Override public AllocationID getAllocationId() { return getSlotContext().getAllocationId(); }
@Nullable private <IN, OUT> OUT findPreviousAllocation( @Nonnull Stream<IN> candidates, @Nonnull Function<IN, SlotContext> contextExtractor, @Nonnull Predicate<IN> additionalRequirementsFilter, @Nonnull BiFunction<IN, Locality, OUT> resultProducer, Collection<AllocationID> priorAllocations) { Predicate<IN> filterByAllocation = (candidate) -> priorAllocations.contains(contextExtractor.apply(candidate).getAllocationId()); return candidates .filter(filterByAllocation.and(additionalRequirementsFilter)) .findFirst() .map((result) -> resultProducer.apply(result, Locality.LOCAL)) // TODO introduce special locality? .orElse(null); }
LOG.trace("Fulfill multi task slot [{}] with slot [{}].", slotRequestId, slotContext.getAllocationId());
LOG.trace("Fulfill multi task slot [{}] with slot [{}].", slotRequestId, slotContext.getAllocationId());
private SingleTaskSlot( SlotRequestId slotRequestId, AbstractID groupId, MultiTaskSlot parent, Locality locality) { super(slotRequestId, groupId); this.parent = Preconditions.checkNotNull(parent); Preconditions.checkNotNull(locality); singleLogicalSlotFuture = parent.getSlotContextFuture() .thenApply( (SlotContext slotContext) -> { LOG.trace("Fulfill single task slot [{}] with slot [{}].", slotRequestId, slotContext.getAllocationId()); return new SingleLogicalSlot( slotRequestId, slotContext, slotSharingGroupId, locality, slotOwner); }); }
private SingleTaskSlot( SlotRequestId slotRequestId, AbstractID groupId, MultiTaskSlot parent, Locality locality) { super(slotRequestId, groupId); this.parent = Preconditions.checkNotNull(parent); Preconditions.checkNotNull(locality); singleLogicalSlotFuture = parent.getSlotContextFuture() .thenApply( (SlotContext slotContext) -> { LOG.trace("Fulfill single task slot [{}] with slot [{}].", slotRequestId, slotContext.getAllocationId()); return new SingleLogicalSlot( slotRequestId, slotContext, slotSharingGroupId, locality, slotOwner); }); }
if (rootSlot.getSlotContextFuture().get().getAllocationId().equals(allocationId)) { if (coLocationConstraint != null) { SlotRequestId coLocationSlotRequestId = new SlotRequestId();