Search in sources :

Example 1 with MyriadStateStore

use of org.apache.myriad.state.MyriadStateStore in project incubator-myriad by apache.

the class MyriadModule method providesSchedulerState.

@Provides
@Singleton
SchedulerState providesSchedulerState(MyriadConfiguration cfg) {
    LOGGER.debug("Configuring SchedulerState provider");
    MyriadStateStore myriadStateStore = null;
    if (cfg.isHAEnabled()) {
        myriadStateStore = providesMyriadStateStore();
        if (myriadStateStore == null) {
            throw new RuntimeException("Could not find a state store" + " implementation for Myriad. The 'yarn.resourcemanager.store.class'" + " property should be set to a class implementing the" + " MyriadStateStore interface. For e.g." + " org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore");
        }
    }
    return new SchedulerState(myriadStateStore);
}
Also used : MyriadStateStore(org.apache.myriad.state.MyriadStateStore) SchedulerState(org.apache.myriad.state.SchedulerState) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Example 2 with MyriadStateStore

use of org.apache.myriad.state.MyriadStateStore in project incubator-myriad by apache.

the class TestObjectFactory method getSchedulerState.

public static SchedulerState getSchedulerState(MyriadConfiguration cfg, String baseDir) throws Exception {
    MyriadStateStore store = TestObjectFactory.getStateStore(new Configuration(), baseDir);
    SchedulerState state = new SchedulerState(store);
    state.setFrameworkId(FrameworkID.newBuilder().setValue("mock-framework").build());
    return state;
}
Also used : MyriadStateStore(org.apache.myriad.state.MyriadStateStore) SchedulerState(org.apache.myriad.state.SchedulerState) Configuration(org.apache.hadoop.conf.Configuration) MyriadConfiguration(org.apache.myriad.configuration.MyriadConfiguration)

Aggregations

MyriadStateStore (org.apache.myriad.state.MyriadStateStore)2 SchedulerState (org.apache.myriad.state.SchedulerState)2 Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 Configuration (org.apache.hadoop.conf.Configuration)1 MyriadConfiguration (org.apache.myriad.configuration.MyriadConfiguration)1