class WorkerSpecContainerResourceAdapter {

	Optional<Resource> tryComputeContainerResource(final WorkerResourceSpec workerResourceSpec) {
		final InternalContainerResource internalContainerResource = workerSpecToContainerResource.computeIfAbsent(
			Preconditions.checkNotNull(workerResourceSpec),
			this::createAndMapContainerResource);
		if (internalContainerResource != null) {
			return Optional.of(internalContainerResource.toResource());
		} else {
			return Optional.empty();
		}
	}

	  WorkerSpecContainerResourceAdapter(
		final Configuration flinkConfig,
		final int minMemMB,
		final int minVcore,
		final int maxMemMB,
		final int maxVcore,
		final int unitMemMB,
		final int unitVcore,
		final Map<String, Long> externalResourceConfigs);

}