[REEF-570] VortexTestSuite fails on Mesos
This addressed the issue by
* In Vortex, directly create EStage without relying on Tang to avoid duplicate configurations.
JIRA:
[REEF-570](https://issues.apache.org/jira/browse/REEF-570)
Pull Request:
This closes #350
diff --git a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexDriver.java b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexDriver.java
index 4dedb1d..ef3061b 100644
--- a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexDriver.java
+++ b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexDriver.java
@@ -36,6 +36,7 @@
import org.apache.reef.wake.EStage;
import org.apache.reef.wake.EventHandler;
import org.apache.reef.wake.impl.SingleThreadStage;
+import org.apache.reef.wake.impl.ThreadPoolStage;
import org.apache.reef.wake.time.event.StartTime;
import javax.inject.Inject;
@@ -71,13 +72,14 @@
private VortexDriver(final EvaluatorRequestor evaluatorRequestor,
final VortexRequestor vortexRequestor,
final VortexMaster vortexMaster,
- final EStage<VortexStart> vortexStartEStage,
final VortexStart vortexStart,
+ final VortexStartExecutor vortexStartExecutor,
final PendingTaskletScheduler pendingTaskletScheduler,
@Parameter(VortexMasterConf.WorkerMem.class) final int workerMem,
@Parameter(VortexMasterConf.WorkerNum.class) final int workerNum,
- @Parameter(VortexMasterConf.WorkerCores.class) final int workerCores) {
- this.vortexStartEStage = vortexStartEStage;
+ @Parameter(VortexMasterConf.WorkerCores.class) final int workerCores,
+ @Parameter(VortexMasterConf.NumberOfVortexStartThreads.class) final int numOfStartThreads) {
+ this.vortexStartEStage = new ThreadPoolStage<>(vortexStartExecutor, numOfStartThreads);
this.vortexStart = vortexStart;
this.pendingTaskletSchedulerEStage = new SingleThreadStage<>(pendingTaskletScheduler, 1);
this.evaluatorRequestor = evaluatorRequestor;
diff --git a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexMasterConf.java b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexMasterConf.java
index 41b7ab2..358dcb7 100644
--- a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexMasterConf.java
+++ b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexMasterConf.java
@@ -27,9 +27,6 @@
import org.apache.reef.tang.formats.RequiredImpl;
import org.apache.reef.tang.formats.RequiredParameter;
import org.apache.reef.vortex.api.VortexStart;
-import org.apache.reef.wake.EStage;
-import org.apache.reef.wake.StageConfiguration;
-import org.apache.reef.wake.impl.ThreadPoolStage;
/**
* Vortex Master configuration.
@@ -59,6 +56,13 @@
}
/**
+ * Number of Vortex Start Threads.
+ */
+ @NamedParameter(doc = "Number of Vortex Start Threads")
+ final class NumberOfVortexStartThreads implements Name<Integer> {
+ }
+
+ /**
* Number of Workers.
*/
public static final RequiredParameter<Integer> WORKER_NUM = new RequiredParameter<>();
@@ -91,8 +95,6 @@
.bindNamedParameter(WorkerMem.class, WORKER_MEM)
.bindNamedParameter(WorkerCores.class, WORKER_CORES)
.bindImplementation(VortexStart.class, VORTEX_START)
- .bindNamedParameter(StageConfiguration.NumberOfThreads.class, NUM_OF_VORTEX_START_THERAD)
- .bindNamedParameter(StageConfiguration.StageHandler.class, VortexStartExecutor.class)
- .bindImplementation(EStage.class, ThreadPoolStage.class)
+ .bindNamedParameter(NumberOfVortexStartThreads.class, NUM_OF_VORTEX_START_THERAD)
.build();
}