use of org.apache.flink.configuration.MemorySize in project flink by apache.
the class ProcessMemoryUtilsTestBase method testConfigLegacyHeapMemory.
private void testConfigLegacyHeapMemory(Configuration configuration, MemorySize expected) {
MemorySize newOptionValue = getConfigurationWithLegacyHeapSizeMappedToNewConfigOption(configuration).get(getNewOptionForLegacyHeapOption());
assertThat(newOptionValue, is(expected));
}
use of org.apache.flink.configuration.MemorySize in project flink by apache.
the class ProcessMemoryUtilsTestBase method getConfigurationWithJvmMetaspaceAndTotalFlinkMemory.
private Configuration getConfigurationWithJvmMetaspaceAndTotalFlinkMemory(long jvmMetaspaceSizeMb, long totalProcessMemorySizeMb) {
MemorySize jvmMetaspaceSize = MemorySize.ofMebiBytes(jvmMetaspaceSizeMb);
MemorySize totalProcessMemorySize = MemorySize.ofMebiBytes(totalProcessMemorySizeMb);
Configuration conf = new Configuration();
conf.set(options.getJvmOptions().getJvmMetaspaceOption(), jvmMetaspaceSize);
conf.set(options.getTotalProcessMemoryOption(), totalProcessMemorySize);
return conf;
}
use of org.apache.flink.configuration.MemorySize in project flink by apache.
the class ProcessMemoryUtilsTestBase method testConfigLegacyHeapMB.
@Test
public void testConfigLegacyHeapMB() {
MemorySize jvmHeapSize = MemorySize.parse("1g");
Configuration conf = new Configuration();
conf.set(legacyMemoryOptions.getHeapMb(), jvmHeapSize.getMebiBytes());
testConfigLegacyHeapMemory(conf, jvmHeapSize);
}
use of org.apache.flink.configuration.MemorySize in project flink by apache.
the class ProcessMemoryUtilsTestBase method testConfigTotalProcessMemoryAddUpFailure.
@Test
public void testConfigTotalProcessMemoryAddUpFailure() {
MemorySize totalProcessMemory = MemorySize.parse("699m");
MemorySize totalFlinkMemory = MemorySize.parse("500m");
MemorySize jvmMetaspace = MemorySize.parse("100m");
MemorySize jvmOverhead = MemorySize.parse("100m");
Configuration conf = new Configuration();
conf.set(options.getTotalProcessMemoryOption(), totalProcessMemory);
conf.set(options.getTotalFlinkMemoryOption(), totalFlinkMemory);
conf.set(options.getJvmOptions().getJvmMetaspaceOption(), jvmMetaspace);
conf.set(options.getJvmOptions().getJvmOverheadMin(), jvmOverhead);
conf.set(options.getJvmOptions().getJvmOverheadMax(), jvmOverhead);
validateFail(conf);
}
use of org.apache.flink.configuration.MemorySize in project flink by apache.
the class ProcessMemoryUtilsTestBase method testConfigTotalProcessMemorySize.
@Test
public void testConfigTotalProcessMemorySize() {
MemorySize totalProcessMemorySize = MemorySize.parse("2g");
Configuration conf = new Configuration();
conf.set(options.getTotalProcessMemoryOption(), totalProcessMemorySize);
T processSpec = processSpecFromConfig(conf);
assertThat(processSpec.getTotalProcessMemorySize(), is(totalProcessMemorySize));
}
Aggregations