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_r199047989
 
 

 ##########
 File path: 
runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/SchedulerRunner.java
 ##########
 @@ -111,16 +116,22 @@ void doScheduleTaskList() {
 
       LOG.debug("Trying to schedule {}...", task.getTaskId());
       executorRegistry.viewExecutors(executors -> {
-        final Set<ExecutorRepresenter> candidateExecutors =
-            schedulingPolicy.filterExecutorRepresenters(executors, task);
-        final Optional<ExecutorRepresenter> firstCandidate = 
candidateExecutors.stream().findFirst();
-
-        if (firstCandidate.isPresent()) {
+        final MutableObject<Set<ExecutorRepresenter>> candidateExecutors = new 
MutableObject<>(executors);
+        task.getExecutionProperties().forEachProperties(property -> {
+          final Optional<SchedulingConstraint> constraint = 
schedulingConstraintRegistry.get(property.getClass());
+          if (constraint.isPresent() && 
!candidateExecutors.getValue().isEmpty()) {
+            candidateExecutors.setValue(candidateExecutors.getValue().stream()
+                .filter(e -> constraint.get().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

Reply via email to