myriad-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smare...@apache.org
Subject [2/2] incubator-myriad git commit: MYRIAD-170 Myriad initialization fails with "parameter 5 of org.apach…
Date Mon, 09 Nov 2015 02:55:41 GMT
MYRIAD-170 Myriad initialization fails with "parameter 5 of org.apach…

…e.myriad.scheduler.MyriadOperations.<init>() is not @Nullable

Myriad State store is no longer passed using Guice
We now get state store from RMContext.

Tried using HA disabled in yarn and myriad. Was able to run CGS and FGS NM's
Tried using HA enabled in yarn and myriad. Was able to run CGS and FGS NM's

This closes: #35
Review: https://github.com/apache/incubator-myriad/pull/35


Project: http://git-wip-us.apache.org/repos/asf/incubator-myriad/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-myriad/commit/343a11ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-myriad/tree/343a11ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-myriad/diff/343a11ac

Branch: refs/heads/master
Commit: 343a11aceb0fc9b5c84f46bba43b2423643eff6f
Parents: 70b95c6
Author: Swapnil Daingade <sdaingade@maprtech.com>
Authored: Sun Nov 8 18:50:54 2015 -0800
Committer: Santosh Marella <marella@gmail.com>
Committed: Sun Nov 8 18:50:54 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/myriad/MyriadModule.java    |  4 +---
 .../myriad/scheduler/MyriadOperations.java      | 20 +++++++++++++-------
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/343a11ac/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java b/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
index 5896e93..41abb9a 100644
--- a/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
+++ b/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
@@ -146,9 +146,7 @@ public class MyriadModule extends AbstractModule {
     return new SchedulerState(myriadStateStore);
   }
 
-  @Provides
-  @Singleton
-  MyriadStateStore providesMyriadStateStore() {
+  private MyriadStateStore providesMyriadStateStore() {
     // TODO (sdaingade) Read the implementation class from yml
     // once multiple implementations are available.
     if (rmContext.getStateStore() instanceof MyriadStateStore) {

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/343a11ac/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/MyriadOperations.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/MyriadOperations.java
b/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/MyriadOperations.java
index c662902..2250eee 100644
--- a/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/MyriadOperations.java
+++ b/myriad-scheduler/src/main/java/org/apache/myriad/scheduler/MyriadOperations.java
@@ -24,6 +24,8 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+
+import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
 import org.apache.mesos.Protos;
 import org.apache.mesos.Protos.Status;
 import org.apache.myriad.configuration.MyriadBadConfigurationException;
@@ -56,13 +58,15 @@ public class MyriadOperations {
   @Inject
   public MyriadOperations(MyriadConfiguration cfg, SchedulerState schedulerState,
       NodeScaleDownPolicy nodeScaleDownPolicy, MyriadDriverManager driverManager,
-      MyriadWebServer myriadWebServer, MyriadStateStore myriadStateStore) {
+      MyriadWebServer myriadWebServer, RMContext rmContext) {
     this.cfg = cfg;
     this.schedulerState = schedulerState;
     this.nodeScaleDownPolicy = nodeScaleDownPolicy;
     this.driverManager = driverManager;
     this.myriadWebServer = myriadWebServer;
-    this.myriadStateStore = myriadStateStore;
+    if (rmContext.getStateStore() instanceof MyriadStateStore) {
+      myriadStateStore = (MyriadStateStore) rmContext.getStateStore();
+    }
   }
 
   public void flexUpCluster(ServiceResourceProfile serviceResourceProfile, int instances,
Constraint constraint) {
@@ -277,11 +281,13 @@ public class MyriadOperations {
       LOGGER.info("Failed to shutdown Myriad webserver: " + e.getMessage());
     }
 
-    try {
-      myriadStateStore.removeMyriadState();
-      LOGGER.info("Myriad State store was removed successfully.");
-    } catch (Exception e) {
-      LOGGER.info("Failed to remove Myriad state store: " + e.getMessage());
+    if (myriadStateStore != null) {
+      try {
+        myriadStateStore.removeMyriadState();
+        LOGGER.info("Myriad State store was removed successfully.");
+      } catch (Exception e) {
+        LOGGER.info("Failed to remove Myriad state store: " + e.getMessage());
+      }
     }
   }
 }


Mime
View raw message