class TaskExecutorMemoryConfiguration implements Serializable {

	public static TaskExecutorMemoryConfiguration create(Configuration config) {
		return new TaskExecutorMemoryConfiguration(
				getConfigurationValue(config, FRAMEWORK_HEAP_MEMORY),
				getConfigurationValue(config, TASK_HEAP_MEMORY),
				getConfigurationValue(config, FRAMEWORK_OFF_HEAP_MEMORY),
				getConfigurationValue(config, TASK_OFF_HEAP_MEMORY),
				getConfigurationValue(config, NETWORK_MEMORY_MAX),
				getConfigurationValue(config, MANAGED_MEMORY_SIZE),
				getConfigurationValue(config, JVM_METASPACE),
			getConfigurationValue(config, JVM_OVERHEAD_MAX),
				getConfigurationValue(config, TOTAL_FLINK_MEMORY),
				getConfigurationValue(config, TOTAL_PROCESS_MEMORY)
		);
	}

	@JsonCreator public  TaskExecutorMemoryConfiguration(
			@JsonProperty(FIELD_NAME_FRAMEWORK_HEAP) Long frameworkHeap,
			@JsonProperty(FIELD_NAME_TASK_HEAP) Long taskHeap,
			@JsonProperty(FIELD_NAME_FRAMEWORK_OFFHEAP) Long frameworkOffHeap,
			@JsonProperty(FIELD_NAME_TASK_OFFHEAP) Long taskOffHeap,
			@JsonProperty(FIELD_NAME_NETWORK_MEMORY) Long networkMemory,
			@JsonProperty(FIELD_NAME_MANAGED_MEMORY) Long managedMemoryTotal,
			@JsonProperty(FIELD_NAME_JVM_METASPACE) Long jvmMetaspace,
			@JsonProperty(FIELD_NAME_JVM_OVERHEAD) Long jvmOverhead,
			@JsonProperty(FIELD_NAME_TOTAL_FLINK_MEMORY) Long totalFlinkMemory,
			@JsonProperty(FIELD_NAME_TOTAL_PROCESS_MEMORY) Long totalProcessMemory);

}