Skip to content

Commit

Permalink
MYRIAD-170 Myriad initialization fails with "parameter 5 of org.apach…
Browse files Browse the repository at this point in the history
…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: #35
  • Loading branch information
sdaingade authored and anveshana committed Nov 9, 2015
1 parent 70b95c6 commit 343a11a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ SchedulerState providesSchedulerState(MyriadConfiguration cfg) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -277,11 +281,13 @@ public void shutdownFramework() {
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());
}
}
}
}

0 comments on commit 343a11a

Please sign in to comment.