You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nemo.apache.org by GitBox <gi...@apache.org> on 2018/06/29 04:04:23 UTC

[GitHub] wonook commented on a change in pull request #57: [NEMO-73, 75] SchedulingPolicy as Vertex-level Execution Property

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:
users@infra.apache.org


With regards,
Apache Git Services