@RpcMethod public void disconnectResourceManager() { this.resourceManagerLeaderId = null; this.resourceManagerGateway = null; }
/** * Unregisters an info message listener * * @param address of the info message listener to unregister from this resource manager * */ @RpcMethod public void unRegisterInfoMessageListener(final String address) { infoMessageListeners.remove(address); }
/** * Register TaskManager to this pool, only those slots come from registered TaskManager will be considered valid. * Also it provides a way for us to keep "dead" or "abnormal" TaskManagers out of this pool. * * @param resourceID The id of the TaskManager */ @RpcMethod public void registerTaskManager(final ResourceID resourceID) { registeredTaskManagers.add(resourceID); }
@RpcMethod public Future<SimpleSlot> allocateSlot( ScheduledUnit task, ResourceProfile resources, Iterable<TaskManagerLocation> locationPreferences) { return internalAllocateSlot(task, resources, locationPreferences); }
@RpcMethod public void heartbeatFromResourceManager(final ResourceID resourceID) { resourceManagerHeartbeatManager.requestHeartbeat(resourceID, null); }
@RpcMethod public void heartbeatFromResourceManager(ResourceID resourceID) { resourceManagerHeartbeatManager.requestHeartbeat(resourceID, null); }
@RpcMethod public void disconnectResourceManager(Exception cause) { closeResourceManagerConnection(cause); }
@RpcMethod public void disconnectTaskManager(final ResourceID resourceId, final Exception cause) { closeTaskManagerConnection(resourceId, cause); }
@RpcMethod public void heartbeatFromJobManager(ResourceID resourceID) { jobManagerHeartbeatManager.requestHeartbeat(resourceID, null); }
/** * Cleanup application and shut down cluster * * @param finalStatus of the Flink application * @param optionalDiagnostics for the Flink application */ @RpcMethod public void shutDownCluster(final ApplicationStatus finalStatus, final String optionalDiagnostics) { log.info("shut down cluster because application is in {}, diagnostics {}", finalStatus, optionalDiagnostics); shutDownApplication(finalStatus, optionalDiagnostics); }
@RpcMethod public Integer getNumberOfRegisteredTaskManagers(UUID requestLeaderSessionId) throws LeaderIdMismatchException { if (Objects.equals(leaderSessionId, requestLeaderSessionId)) { return taskExecutors.size(); } else { throw new LeaderIdMismatchException(leaderSessionId, requestLeaderSessionId); } }
@RpcMethod public Iterable<SlotOffer> offerSlots(Iterable<Tuple2<AllocatedSlot, SlotOffer>> offers) { validateRunsInMainThread(); final ArrayList<SlotOffer> result = new ArrayList<>(); for (Tuple2<AllocatedSlot, SlotOffer> offer : offers) { if (offerSlot(offer.f0)) { result.add(offer.f1); } } return result.isEmpty() ? Collections.<SlotOffer>emptyList() : result; }
@RpcMethod public void failSlot(final ResourceID taskManagerId, final AllocationID allocationId, final UUID leaderId, final Exception cause) throws Exception { validateLeaderSessionId(leaderSessionID); if (!registeredTaskManagers.containsKey(taskManagerId)) { throw new Exception("Unknown TaskManager " + taskManagerId); } slotPoolGateway.failAllocation(allocationId, cause); }
@RpcMethod public void failPartition(ExecutionAttemptID executionAttemptID) { log.info("Discarding the results produced by task execution {}.", executionAttemptID); try { networkEnvironment.getResultPartitionManager().releasePartitionsProducedBy(executionAttemptID); } catch (Throwable t) { // TODO: Do we still need this catch branch? onFatalError(t); } // TODO: Maybe it's better to return an Acknowledge here to notify the JM about the success/failure with an Exception }
@RpcMethod public void disconnectResourceManager( final UUID jobManagerLeaderId, final UUID resourceManagerLeaderId, final Exception cause) throws Exception { validateLeaderSessionId(jobManagerLeaderId); if (resourceManagerConnection != null && resourceManagerConnection.getTargetLeaderId().equals(resourceManagerLeaderId)) { closeResourceManagerConnection(cause); } }
@RpcMethod public KvStateLocation lookupKvStateLocation(final String registrationName) throws Exception { if (log.isDebugEnabled()) { log.debug("Lookup key-value state for job {} with registration " + "name {}.", jobGraph.getJobID(), registrationName); } final KvStateLocationRegistry registry = executionGraph.getKvStateLocationRegistry(); final KvStateLocation location = registry.getKvStateLocation(registrationName); if (location != null) { return location; } else { throw new UnknownKvStateLocation(registrationName); } }
@RpcMethod public void disconnectTaskManager(final ResourceID resourceID, final Exception cause) { taskManagerHeartbeatManager.unmonitorTarget(resourceID); slotPoolGateway.releaseTaskManager(resourceID); Tuple2<TaskManagerLocation, TaskExecutorGateway> taskManagerConnection = registeredTaskManagers.remove(resourceID); if (taskManagerConnection != null) { taskManagerConnection.f1.disconnectJobManager(jobGraph.getJobID(), cause); } }
@RpcMethod public Acknowledge scheduleOrUpdateConsumers( final UUID leaderSessionID, final ResultPartitionID partitionID) throws Exception { validateLeaderSessionId(leaderSessionID); executionGraph.scheduleOrUpdateConsumers(partitionID); return Acknowledge.get(); }
@RpcMethod public void connectToResourceManager(UUID resourceManagerLeaderId, ResourceManagerGateway resourceManagerGateway) { this.resourceManagerLeaderId = checkNotNull(resourceManagerLeaderId); this.resourceManagerGateway = checkNotNull(resourceManagerGateway); // work on all slots waiting for this connection for (PendingRequest pending : waitingForResourceManager.values()) { requestSlotFromResourceManager(pending.allocationID(), pending.future(), pending.resourceProfile()); } // all sent off waitingForResourceManager.clear(); }
@RpcMethod public ClassloadingProps requestClassloadingProps() throws Exception { return new ClassloadingProps(libraryCacheManager.getBlobServerPort(), executionGraph.getRequiredJarFiles(), executionGraph.getRequiredClasspaths()); }