You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by we...@apache.org on 2017/08/28 16:23:43 UTC

reef git commit: [REEF-1793] Add configuration options for local thread mode

Repository: reef
Updated Branches:
  refs/heads/master 8be63d230 -> 9937c7519


[REEF-1793] Add configuration options for local thread mode

This adds configuration options for local thread mode.

JIRA:
  [REEF-1793](https://issues.apache.org/jira/browse/REEF-1793)

Pull request:
  This closes #1304


Project: http://git-wip-us.apache.org/repos/asf/reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/9937c751
Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/9937c751
Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/9937c751

Branch: refs/heads/master
Commit: 9937c7519257a7034568938adbddfa3ebb98697b
Parents: 8be63d2
Author: interesaaat <90...@studenti.unimore.it>
Authored: Fri May 12 23:25:27 2017 -0700
Committer: Markus Weimer <we...@apache.org>
Committed: Mon Aug 28 09:22:17 2017 -0700

----------------------------------------------------------------------
 .../evaluator/parameters/LocalThreadMode.java   | 36 ++++++++++++++++++++
 .../local/client/LocalRuntimeConfiguration.java |  7 ++++
 .../local/driver/LocalDriverConfiguration.java  |  7 ++++
 3 files changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/reef/blob/9937c751/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/parameters/LocalThreadMode.java
----------------------------------------------------------------------
diff --git a/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/parameters/LocalThreadMode.java b/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/parameters/LocalThreadMode.java
new file mode 100644
index 0000000..61847af
--- /dev/null
+++ b/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/parameters/LocalThreadMode.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.reef.runtime.common.evaluator.parameters;
+
+import org.apache.reef.tang.annotations.Name;
+import org.apache.reef.tang.annotations.NamedParameter;
+
+/**
+ * Flag used to set whether we are running in local thread mode or not.
+ */
+@NamedParameter(doc = "Flag for local thread mode.", default_value = LocalThreadMode.NO)
+public final class LocalThreadMode implements Name<String> {
+  public static final String YES = "YES";
+  public static final String NO = "NO";
+
+  private LocalThreadMode() {
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/reef/blob/9937c751/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/LocalRuntimeConfiguration.java
----------------------------------------------------------------------
diff --git a/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/LocalRuntimeConfiguration.java b/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/LocalRuntimeConfiguration.java
index e27fef1..25e8eb3 100644
--- a/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/LocalRuntimeConfiguration.java
+++ b/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/LocalRuntimeConfiguration.java
@@ -23,6 +23,7 @@ import org.apache.reef.runtime.common.client.CommonRuntimeConfiguration;
 import org.apache.reef.runtime.common.client.DriverConfigurationProvider;
 import org.apache.reef.runtime.common.client.api.JobSubmissionHandler;
 import org.apache.reef.runtime.common.driver.parameters.DefinedRuntimes;
+import org.apache.reef.runtime.common.evaluator.parameters.LocalThreadMode;
 import org.apache.reef.runtime.common.files.RuntimeClasspathProvider;
 import org.apache.reef.runtime.common.parameters.JVMHeapSlack;
 import org.apache.reef.runtime.local.LocalClasspathProvider;
@@ -72,6 +73,11 @@ public class LocalRuntimeConfiguration extends ConfigurationModuleBuilder {
   public static final OptionalParameter<String> RACK_NAMES = new OptionalParameter<>();
 
   /**
+   * Whether the local runtime executes on thread mode or not.
+   */
+  public static final OptionalParameter<String> IS_LOCAL_THREAD_MODE = new OptionalParameter<>();
+
+  /**
    * The ConfigurationModule for the local resourcemanager.
    */
   public static final ConfigurationModule CONF = new LocalRuntimeConfiguration()
@@ -85,6 +91,7 @@ public class LocalRuntimeConfiguration extends ConfigurationModuleBuilder {
       .bindNamedParameter(MaxNumberOfEvaluators.class, MAX_NUMBER_OF_EVALUATORS)
       .bindNamedParameter(RootFolder.class, RUNTIME_ROOT_FOLDER)
       .bindNamedParameter(JVMHeapSlack.class, JVM_HEAP_SLACK)
+      .bindNamedParameter(LocalThreadMode.class, IS_LOCAL_THREAD_MODE)
       .bindSetEntry(DriverConfigurationProviders.class, DRIVER_CONFIGURATION_PROVIDERS)
       .bindSetEntry(RackNames.class, RACK_NAMES)
       .bindSetEntry(DefinedRuntimes.class, RuntimeIdentifier.RUNTIME_NAME)

http://git-wip-us.apache.org/repos/asf/reef/blob/9937c751/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/LocalDriverConfiguration.java
----------------------------------------------------------------------
diff --git a/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/LocalDriverConfiguration.java b/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/LocalDriverConfiguration.java
index 2b7ba09..a60579e 100644
--- a/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/LocalDriverConfiguration.java
+++ b/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/LocalDriverConfiguration.java
@@ -23,6 +23,7 @@ import org.apache.reef.runtime.common.driver.client.JobStatusHandler;
 import org.apache.reef.runtime.common.driver.parameters.ClientRemoteIdentifier;
 import org.apache.reef.runtime.common.driver.parameters.DefinedRuntimes;
 import org.apache.reef.runtime.common.driver.parameters.JobIdentifier;
+import org.apache.reef.runtime.common.evaluator.parameters.LocalThreadMode;
 import org.apache.reef.runtime.common.files.RuntimeClasspathProvider;
 import org.apache.reef.runtime.common.launch.parameters.ErrorHandlerRID;
 import org.apache.reef.runtime.common.launch.parameters.LaunchID;
@@ -71,6 +72,11 @@ public class LocalDriverConfiguration extends ConfigurationModuleBuilder {
   public static final OptionalImpl<JobStatusHandler> JOB_STATUS_HANDLER = new OptionalImpl<>();
 
   /**
+   * Whether the local driver executes on thread mode or not.
+   */
+  public static final OptionalParameter<String> IS_LOCAL_THREAD_MODE = new OptionalParameter<>();
+
+  /**
    * The identifier of the Job submitted.
    */
   public static final RequiredParameter<String> JOB_IDENTIFIER = new RequiredParameter<>();
@@ -89,6 +95,7 @@ public class LocalDriverConfiguration extends ConfigurationModuleBuilder {
       .bindNamedParameter(MaxNumberOfEvaluators.class, MAX_NUMBER_OF_EVALUATORS)
       .bindNamedParameter(RootFolder.class, ROOT_FOLDER)
       .bindNamedParameter(JVMHeapSlack.class, JVM_HEAP_SLACK)
+      .bindNamedParameter(LocalThreadMode.class, IS_LOCAL_THREAD_MODE)
       .bindSetEntry(RackNames.class, RACK_NAMES)
       .bindImplementation(RuntimeClasspathProvider.class, LocalClasspathProvider.class)
       .bindSetEntry(DefinedRuntimes.class, RUNTIME_NAMES)