code: public static TaskManagerServicesConfiguration fromConfiguration(
  			Configuration configuration,
  			long maxJvmHeapMemory,
  			InetAddress remoteAddress,
  			boolean localCommunication) {
  		final String[] tmpDirs = ConfigurationUtils.parseTempDirectories(configuration);
  		String[] localStateRootDir = ConfigurationUtils.parseLocalStateDirectories(configuration);
  		if (localStateRootDir.length == 0) {
  			// default to temp dirs.
  			localStateRootDir = tmpDirs;
  		}
  
  		boolean localRecoveryMode = configuration.getBoolean(CheckpointingOptions.LOCAL_RECOVERY);
  
  		final NetworkEnvironmentConfiguration networkConfig = NetworkEnvironmentConfiguration.fromConfiguration(
  			configuration,
  			maxJvmHeapMemory,
  			localCommunication,
  			remoteAddress);
  
  		final QueryableStateConfiguration queryableStateConfig = QueryableStateConfiguration.fromConfiguration(configuration);
  
  		boolean preAllocateMemory = configuration.getBoolean(TaskManagerOptions.MANAGED_MEMORY_PRE_ALLOCATE);
  
  		long timerServiceShutdownTimeout = AkkaUtils.getTimeout(configuration).toMillis();
  
  		final RetryingRegistrationConfiguration retryingRegistrationConfiguration = RetryingRegistrationConfiguration.fromConfiguration(configuration);
  
  		return new TaskManagerServicesConfiguration(
  			remoteAddress,
  			tmpDirs,
  			localStateRootDir,
  			localRecoveryMode,
  			networkConfig,
  			queryableStateConfig,
  			ConfigurationParserUtils.getSlot(configuration),
  			ConfigurationParserUtils.getManagedMemorySize(configuration),
  			ConfigurationParserUtils.getMemoryType(configuration),
  			preAllocateMemory,
  			ConfigurationParserUtils.getManagedMemoryFraction(configuration),
  			timerServiceShutdownTimeout,
  			retryingRegistrationConfiguration,
  			ConfigurationUtils.getSystemResourceMetricsProbingInterval(configuration));
  	}
docs: Utility method to extract TaskManager config parameters from the configuration and to
  sanity check them.
  
  @param configuration The configuration.
  @param maxJvmHeapMemory The maximum JVM heap size, in bytes.
  @param remoteAddress identifying the IP address under which the TaskManager will be accessible
  @param localCommunication True, to skip initializing the network stack.
  Use only in cases where only one task manager runs.
  @return TaskExecutorConfiguration that wrappers InstanceConnectionInfo, NetworkEnvironmentConfiguration, etc.