wonook commented on a change in pull request #57: [NEMO-73,75] SchedulingPolicy
as Vertex-level Execution Property
URL: https://github.com/apache/incubator-nemo/pull/57#discussion_r199048121
##########
File path:
runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/FreeSlotSchedulingConstraintTest.java
##########
@@ -47,18 +49,19 @@ private static ExecutorRepresenter
mockExecutorRepresenter(final int numRunningT
@Test
public void testFreeSlot() {
- final SchedulingPolicy schedulingPolicy = new FreeSlotSchedulingPolicy();
+ final SchedulingConstraint schedulingConstraint = new
FreeSlotSchedulingConstraint();
final ExecutorRepresenter a0 = mockExecutorRepresenter(1, 1);
final ExecutorRepresenter a1 = mockExecutorRepresenter(2, 3);
final Task task = mock(Task.class);
+
when(task.getPropertyValue(ExecutorSlotComplianceProperty.class)).thenReturn(Optional.of(true));
final Set<ExecutorRepresenter> executorRepresenterList = new
HashSet<>(Arrays.asList(a0, a1));
- final Set<ExecutorRepresenter> candidateExecutors =
- schedulingPolicy.filterExecutorRepresenters(executorRepresenterList,
task);
+ final Set<ExecutorRepresenter> candidateExecutors =
executorRepresenterList.stream()
+ .filter(e -> schedulingConstraint.testSchedulability(e,
task)).collect(Collectors.toSet());
Review comment:
newline!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services