use of org.apache.flink.runtime.resourcemanager.WorkerResourceSpec in project flink by apache.
the class SlotManagerUtilsTest method testGenerateTaskManagerTotalResourceProfile.
@Test
public void testGenerateTaskManagerTotalResourceProfile() {
final ResourceProfile resourceProfile = ResourceProfile.newBuilder().setCpuCores(1.0).setTaskHeapMemoryMB(1).setTaskOffHeapMemoryMB(2).setNetworkMemoryMB(3).setManagedMemoryMB(4).setExtendedResource(new ExternalResource(EXTERNAL_RESOURCE_NAME, 1)).build();
final WorkerResourceSpec workerResourceSpec = new WorkerResourceSpec.Builder().setCpuCores(1.0).setTaskHeapMemoryMB(1).setTaskOffHeapMemoryMB(2).setNetworkMemoryMB(3).setManagedMemoryMB(4).setExtendedResource(new ExternalResource(EXTERNAL_RESOURCE_NAME, 1)).build();
assertThat(SlotManagerUtils.generateTaskManagerTotalResourceProfile(workerResourceSpec), equalTo(resourceProfile));
}
Aggregations