@Override public Future<Void> retrievePayload() { return FlinkCompletableFuture.completed(null); } }
@Override public Future<SimpleSlot> allocateSlot(ScheduledUnit task, boolean allowQueued) { try { final Object ret = scheduleTask(task, allowQueued); if (ret instanceof SimpleSlot) { return FlinkCompletableFuture.completed((SimpleSlot) ret); } else if (ret instanceof Future) { @SuppressWarnings("unchecked") Future<SimpleSlot> typed = (Future<SimpleSlot>) ret; return typed; } else { // this should never happen, simply guard this case with an exception throw new RuntimeException(); } } catch (NoResourceAvailableException e) { return FlinkCompletableFuture.completedExceptionally(e); } }
@Override public Future<Void> retrievePayload() { return FlinkCompletableFuture.completed(null); } }
resourceManagerLeaderId, leaderSessionId); return FlinkCompletableFuture.<RegistrationResponse>completed( new RegistrationResponse.Decline("Resource manager leader id did not match."));
@Override public Future<Void> retrievePayload() { return FlinkCompletableFuture.completed(null); } }
@Override public Future<Void> retrievePayload() { return FlinkCompletableFuture.completed(null); } }
public WatermarkQueueEntry(Watermark watermark) { super(watermark); this.future = FlinkCompletableFuture.completed(watermark); }
leaderIdFuture = FlinkCompletableFuture.completed(leaderSessionId); } else { leaderIdFuture.complete(leaderSessionId);
final RegistrationResponse response = new JMTMRegistrationSuccess( resourceId, libraryCacheManager.getBlobServerPort()); return FlinkCompletableFuture.completed(response); } else { return getRpcService().execute(new Callable<TaskExecutorGateway>() {
taskExecutorResourceId, taskExecutorAddress, leaderSessionId, resourceManagerLeaderId); return FlinkCompletableFuture.<RegistrationResponse>completed( new RegistrationResponse.Decline("Discard registration because the leader id " + resourceManagerLeaderId + " does not match the expected leader id " +
Future<SimpleSlot> internalAllocateSlot( ScheduledUnit task, ResourceProfile resources, Iterable<TaskManagerLocation> locationPreferences) { // (1) do we have a slot available already? SlotAndLocality slotFromPool = availableSlots.poll(resources, locationPreferences); if (slotFromPool != null) { SimpleSlot slot = createSimpleSlot(slotFromPool.slot(), slotFromPool.locality()); allocatedSlots.add(slot); return FlinkCompletableFuture.completed(slot); } // the request will be completed by a future final AllocationID allocationID = new AllocationID(); final FlinkCompletableFuture<SimpleSlot> future = new FlinkCompletableFuture<>(); // (2) need to request a slot if (resourceManagerGateway == null) { // no slot available, and no resource manager connection stashRequestWaitingForResourceManager(allocationID, resources, future); } else { // we have a resource manager connection, so let's ask it for more resources requestSlotFromResourceManager(allocationID, future, resources); } return future; }