johnyangk closed pull request #40: [NEMO-74] Rename RoundRobinSchedulingPolicy
to MinOccupancyFirstSchedulingPolicy
URL: https://github.com/apache/incubator-nemo/pull/40
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/CompositeSchedulingPolicy.java
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/CompositeSchedulingPolicy.java
index e15e401b..213f5f19 100644
---
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/CompositeSchedulingPolicy.java
+++
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/CompositeSchedulingPolicy.java
@@ -34,14 +34,14 @@
@Inject
private CompositeSchedulingPolicy(final SourceLocationAwareSchedulingPolicy
sourceLocationAwareSchedulingPolicy,
- final RoundRobinSchedulingPolicy
roundRobinSchedulingPolicy,
+ final MinOccupancyFirstSchedulingPolicy
minOccupancyFirstSchedulingPolicy,
final FreeSlotSchedulingPolicy
freeSlotSchedulingPolicy,
final ContainerTypeAwareSchedulingPolicy
containerTypeAwareSchedulingPolicy) {
schedulingPolicies = Arrays.asList(
freeSlotSchedulingPolicy,
containerTypeAwareSchedulingPolicy,
sourceLocationAwareSchedulingPolicy,
- roundRobinSchedulingPolicy);
+ minOccupancyFirstSchedulingPolicy);
}
@Override
diff --git
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicy.java
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicy.java
similarity index 79%
rename from
runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicy.java
rename to
runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicy.java
index 5c6e65c3..120e1fb0 100644
---
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicy.java
+++
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicy.java
@@ -30,23 +30,22 @@
/**
* {@inheritDoc}
- * A Round-Robin implementation used by {@link BatchSingleJobScheduler}.
+ * A scheduling policy used by {@link BatchSingleJobScheduler}.
*
- * This policy keeps a list of available {@link ExecutorRepresenter} for each
type of container.
- * The RR policy is used for each container type when trying to schedule a
task.
+ * This policy chooses a set of Executors, on which have minimum running Tasks.
*/
@ThreadSafe
@DriverSide
-public final class RoundRobinSchedulingPolicy implements SchedulingPolicy {
- private static final Logger LOG =
LoggerFactory.getLogger(RoundRobinSchedulingPolicy.class.getName());
+public final class MinOccupancyFirstSchedulingPolicy implements
SchedulingPolicy {
+ private static final Logger LOG =
LoggerFactory.getLogger(MinOccupancyFirstSchedulingPolicy.class.getName());
@VisibleForTesting
@Inject
- public RoundRobinSchedulingPolicy() {
+ public MinOccupancyFirstSchedulingPolicy() {
}
/**
- * @param executorRepresenterSet Set of {@link ExecutorRepresenter} to be
filtered by round robin behaviour.
+ * @param executorRepresenterSet Set of {@link ExecutorRepresenter} to be
filtered by the occupancy of the Executors.
* @param task {@link Task} to be scheduled.
* @return filtered Set of {@link ExecutorRepresenter}.
*/
diff --git
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/SourceLocationAwareSchedulingPolicy.java
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/SourceLocationAwareSchedulingPolicy.java
index 35dbb07f..f84f8a85 100644
---
a/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/SourceLocationAwareSchedulingPolicy.java
+++
b/runtime/master/src/main/java/edu/snu/nemo/runtime/master/scheduler/SourceLocationAwareSchedulingPolicy.java
@@ -29,7 +29,7 @@
import java.util.stream.Collectors;
/**
- * This policy is same as {@link RoundRobinSchedulingPolicy}, however for Tasks
+ * This policy is same as {@link MinOccupancyFirstSchedulingPolicy}, however
for Tasks
* with {@link edu.snu.nemo.common.ir.vertex.SourceVertex}, it tries to pick
one of the executors
* where the corresponding data resides.
*/
diff --git
a/runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicyTest.java
b/runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicyTest.java
similarity index 92%
rename from
runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicyTest.java
rename to
runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicyTest.java
index 57aa8cbe..60311a63 100644
---
a/runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/RoundRobinSchedulingPolicyTest.java
+++
b/runtime/master/src/test/java/edu/snu/nemo/runtime/master/scheduler/MinOccupancyFirstSchedulingPolicyTest.java
@@ -29,11 +29,11 @@
import static org.mockito.Mockito.*;
/**
- * Tests {@link RoundRobinSchedulingPolicy}
+ * Tests {@link MinOccupancyFirstSchedulingPolicy}
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({ExecutorRepresenter.class, Task.class})
-public final class RoundRobinSchedulingPolicyTest {
+public final class MinOccupancyFirstSchedulingPolicyTest {
private static ExecutorRepresenter mockExecutorRepresenter(final int
numRunningTasks) {
final ExecutorRepresenter executorRepresenter =
mock(ExecutorRepresenter.class);
@@ -45,7 +45,7 @@ private static ExecutorRepresenter
mockExecutorRepresenter(final int numRunningT
@Test
public void testRoundRobin() {
- final SchedulingPolicy schedulingPolicy = new RoundRobinSchedulingPolicy();
+ final SchedulingPolicy schedulingPolicy = new
MinOccupancyFirstSchedulingPolicy();
final ExecutorRepresenter a0 = mockExecutorRepresenter(1);
final ExecutorRepresenter a1 = mockExecutorRepresenter(2);
final ExecutorRepresenter a2 = mockExecutorRepresenter(2);
----------------------------------------------------------------
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