class ResourceManager extends FencedRpcEndpoint<ResourceManagerId> implements ResourceManagerGateway, LeaderContender {

	@Override
	public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) {

		final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size());

		for (Map.Entry<ResourceID, WorkerRegistration<WorkerType>> taskExecutorEntry : taskExecutors.entrySet()) {
			final ResourceID resourceId = taskExecutorEntry.getKey();
			final WorkerRegistration<WorkerType> taskExecutor = taskExecutorEntry.getValue();

			taskManagerInfos.add(
				new TaskManagerInfo(
					resourceId,
					taskExecutor.getTaskExecutorGateway().getAddress(),
					taskExecutor.getDataPort(),
					taskManagerHeartbeatManager.getLastHeartbeatFrom(resourceId),
					slotManager.getNumberRegisteredSlotsOf(taskExecutor.getInstanceID()),
					slotManager.getNumberFreeSlotsOf(taskExecutor.getInstanceID()),
					taskExecutor.getHardwareDescription()));
		}

		return CompletableFuture.completedFuture(taskManagerInfos);
	}

	public  ResourceManager(
			RpcService rpcService,
			String resourceManagerEndpointId,
			ResourceID resourceId,
			ResourceManagerConfiguration resourceManagerConfiguration,
			HighAvailabilityServices highAvailabilityServices,
			HeartbeatServices heartbeatServices,
			SlotManager slotManager,
			MetricRegistry metricRegistry,
			JobLeaderIdService jobLeaderIdService,
			ClusterInformation clusterInformation,
			FatalErrorHandler fatalErrorHandler);

}