azagrebin commented on a change in pull request #7809: [FLINK-11710][tests] Refactor SimpleSlotProvider to TestingLogicalSlo… URL: https://github.com/apache/flink/pull/7809#discussion_r273189296
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/utils/TestingLogicalSlotProvider.java ########## @@ -53,30 +52,31 @@ /** * A testing utility slot provider that simply has a predefined pool of slots. */ -public class SimpleSlotProvider implements SlotProvider, SlotOwner { +public class TestingLogicalSlotProvider implements SlotProvider, SlotOwner { private final Object lock = new Object(); private final ArrayDeque<SlotContext> slots; private final HashMap<SlotRequestId, SlotContext> allocatedSlots; - public SimpleSlotProvider(JobID jobId, int numSlots) { + public TestingLogicalSlotProvider(JobID jobId, int numSlots) { this(jobId, numSlots, new SimpleAckingTaskManagerGateway()); } - public SimpleSlotProvider(JobID jobId, int numSlots, TaskManagerGateway taskManagerGateway) { + public TestingLogicalSlotProvider(JobID jobId, int numSlots, TaskManagerGateway taskManagerGateway) { checkNotNull(jobId, "jobId"); checkArgument(numSlots >= 0, "numSlots must be >= 0"); this.slots = new ArrayDeque<>(numSlots); for (int i = 0; i < numSlots; i++) { - SimpleSlotContext as = new SimpleSlotContext( + SettableSlotContext as = new SettableSlotContext( Review comment: Do we actually need to keep `SlotContext` in `slots`? Could it be just immediately `LogicalSlot`? That might simplify everything and then the `TestingLogicalSlot/SettableSlotContext` would not need to be created all the time. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services