use of org.apache.flink.runtime.instance.SimpleSlotContext in project flink by apache.
the class DeclarativeSlotPoolServiceTest method testCreateAllocatedSlotReport.
@Test
public void testCreateAllocatedSlotReport() throws Exception {
final LocalTaskManagerLocation taskManagerLocation1 = new LocalTaskManagerLocation();
final LocalTaskManagerLocation taskManagerLocation2 = new LocalTaskManagerLocation();
final SimpleSlotContext simpleSlotContext2 = createSimpleSlotContext(taskManagerLocation2);
final Collection<SlotInfo> slotInfos = Arrays.asList(createSimpleSlotContext(taskManagerLocation1), simpleSlotContext2);
try (DeclarativeSlotPoolService declarativeSlotPoolService = createDeclarativeSlotPoolService(new TestingDeclarativeSlotPoolFactory(new TestingDeclarativeSlotPoolBuilder().setGetAllSlotsInformationSupplier(() -> slotInfos)))) {
final AllocatedSlotReport allocatedSlotReport = declarativeSlotPoolService.createAllocatedSlotReport(taskManagerLocation2.getResourceID());
assertThat(allocatedSlotReport.getAllocatedSlotInfos(), contains(matchesWithSlotContext(simpleSlotContext2)));
}
}
Aggregations