Java Code Examples for org.apache.flink.runtime.resourcemanager.registration.WorkerRegistration#getInstanceID()
The following examples show how to use
org.apache.flink.runtime.resourcemanager.registration.WorkerRegistration#getInstanceID() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResourceManager.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Override public void notifySlotAvailable( final InstanceID instanceID, final SlotID slotId, final AllocationID allocationId) { final ResourceID resourceId = slotId.getResourceID(); WorkerRegistration<WorkerType> registration = taskExecutors.get(resourceId); if (registration != null) { InstanceID registrationId = registration.getInstanceID(); if (Objects.equals(registrationId, instanceID)) { slotManager.freeSlot(slotId, allocationId); } else { log.debug("Invalid registration id for slot available message. This indicates an" + " outdated request."); } } else { log.debug("Could not find registration for resource id {}. Discarding the slot available" + "message {}.", resourceId, slotId); } }
Example 2
Source File: ResourceManager.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Override public CompletableFuture<TaskManagerInfo> requestTaskManagerInfo(ResourceID resourceId, Time timeout) { final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(resourceId); if (taskExecutor == null) { return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(resourceId)); } else { final InstanceID instanceId = taskExecutor.getInstanceID(); final TaskManagerInfo taskManagerInfo = new TaskManagerInfo( resourceId, taskExecutor.getTaskExecutorGateway().getAddress(), taskExecutor.getDataPort(), taskManagerHeartbeatManager.getLastHeartbeatFrom(resourceId), slotManager.getNumberRegisteredSlotsOf(instanceId), slotManager.getNumberFreeSlotsOf(instanceId), taskExecutor.getHardwareDescription()); return CompletableFuture.completedFuture(taskManagerInfo); } }
Example 3
Source File: ResourceManager.java From flink with Apache License 2.0 | 6 votes |
@Override public void notifySlotAvailable( final InstanceID instanceID, final SlotID slotId, final AllocationID allocationId) { final ResourceID resourceId = slotId.getResourceID(); WorkerRegistration<WorkerType> registration = taskExecutors.get(resourceId); if (registration != null) { InstanceID registrationId = registration.getInstanceID(); if (Objects.equals(registrationId, instanceID)) { slotManager.freeSlot(slotId, allocationId); } else { log.debug("Invalid registration id for slot available message. This indicates an" + " outdated request."); } } else { log.debug("Could not find registration for resource id {}. Discarding the slot available" + "message {}.", resourceId, slotId); } }
Example 4
Source File: ResourceManager.java From flink with Apache License 2.0 | 6 votes |
@Override public CompletableFuture<TaskManagerInfo> requestTaskManagerInfo(ResourceID resourceId, Time timeout) { final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(resourceId); if (taskExecutor == null) { return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(resourceId)); } else { final InstanceID instanceId = taskExecutor.getInstanceID(); final TaskManagerInfo taskManagerInfo = new TaskManagerInfo( resourceId, taskExecutor.getTaskExecutorGateway().getAddress(), taskExecutor.getDataPort(), taskManagerHeartbeatManager.getLastHeartbeatFrom(resourceId), slotManager.getNumberRegisteredSlotsOf(instanceId), slotManager.getNumberFreeSlotsOf(instanceId), taskExecutor.getHardwareDescription()); return CompletableFuture.completedFuture(taskManagerInfo); } }
Example 5
Source File: ResourceManager.java From flink with Apache License 2.0 | 6 votes |
@Override public void notifySlotAvailable( final InstanceID instanceID, final SlotID slotId, final AllocationID allocationId) { final ResourceID resourceId = slotId.getResourceID(); WorkerRegistration<WorkerType> registration = taskExecutors.get(resourceId); if (registration != null) { InstanceID registrationId = registration.getInstanceID(); if (Objects.equals(registrationId, instanceID)) { slotManager.freeSlot(slotId, allocationId); } else { log.debug("Invalid registration id for slot available message. This indicates an" + " outdated request."); } } else { log.debug("Could not find registration for resource id {}. Discarding the slot available" + "message {}.", resourceId, slotId); } }
Example 6
Source File: ResourceManager.java From flink with Apache License 2.0 | 6 votes |
@Override public CompletableFuture<TaskManagerInfo> requestTaskManagerInfo(ResourceID resourceId, Time timeout) { final WorkerRegistration<WorkerType> taskExecutor = taskExecutors.get(resourceId); if (taskExecutor == null) { return FutureUtils.completedExceptionally(new UnknownTaskExecutorException(resourceId)); } else { final InstanceID instanceId = taskExecutor.getInstanceID(); final TaskManagerInfo taskManagerInfo = new TaskManagerInfo( resourceId, taskExecutor.getTaskExecutorGateway().getAddress(), taskExecutor.getDataPort(), taskManagerHeartbeatManager.getLastHeartbeatFrom(resourceId), slotManager.getNumberRegisteredSlotsOf(instanceId), slotManager.getNumberFreeSlotsOf(instanceId), slotManager.getRegisteredResourceOf(instanceId), slotManager.getFreeResourceOf(instanceId), taskExecutor.getHardwareDescription()); return CompletableFuture.completedFuture(taskManagerInfo); } }
Example 7
Source File: ResourceManager.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Override public void reportPayload(final ResourceID resourceID, final SlotReport payload) { validateRunsInMainThread(); final WorkerRegistration<WorkerType> workerRegistration = taskExecutors.get(resourceID); if (workerRegistration == null) { log.debug("Received slot report from TaskManager {} which is no longer registered.", resourceID); } else { InstanceID instanceId = workerRegistration.getInstanceID(); slotManager.reportSlotStatus(instanceId, payload); } }
Example 8
Source File: ResourceManager.java From flink with Apache License 2.0 | 5 votes |
@Override public void reportPayload(final ResourceID resourceID, final SlotReport payload) { validateRunsInMainThread(); final WorkerRegistration<WorkerType> workerRegistration = taskExecutors.get(resourceID); if (workerRegistration == null) { log.debug("Received slot report from TaskManager {} which is no longer registered.", resourceID); } else { InstanceID instanceId = workerRegistration.getInstanceID(); slotManager.reportSlotStatus(instanceId, payload); } }
Example 9
Source File: ResourceManager.java From flink with Apache License 2.0 | 5 votes |
@Override public void reportPayload(final ResourceID resourceID, final TaskExecutorHeartbeatPayload payload) { validateRunsInMainThread(); final WorkerRegistration<WorkerType> workerRegistration = taskExecutors.get(resourceID); if (workerRegistration == null) { log.debug("Received slot report from TaskManager {} which is no longer registered.", resourceID); } else { InstanceID instanceId = workerRegistration.getInstanceID(); slotManager.reportSlotStatus(instanceId, payload.getSlotReport()); clusterPartitionTracker.processTaskExecutorClusterPartitionReport(resourceID, payload.getClusterPartitionReport()); } }