Search in sources :

Example 1 with MockDispatcher

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

the class TestObjectFactory method getStateStore.

public static MyriadFileSystemRMStateStore getStateStore(Configuration conf, String baseDir) throws Exception {
    conf.set("yarn.resourcemanager.fs.state-store.uri", "file:///" + baseDir);
    MyriadFileSystemRMStateStore store = new MyriadFileSystemRMStateStore();
    store.init(conf);
    store.start();
    store.loadState();
    store.setRMDispatcher(new MockDispatcher());
    return store;
}
Also used : MyriadFileSystemRMStateStore(org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore) MockDispatcher(org.apache.myriad.state.MockDispatcher)

Example 2 with MockDispatcher

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

the class MyriadOperationsTest method generateRMContext.

private RMContext generateRMContext(AbstractYarnScheduler<FiCaSchedulerApp, FiCaSchedulerNode> scheduler) throws Exception {
    Configuration conf = new Configuration();
    MockRMContext context = null;
    Dispatcher dispatcher = new MockDispatcher();
    RMApplicationHistoryWriter rmApplicationHistoryWriter = new RMApplicationHistoryWriter();
    AMLivelinessMonitor amLivelinessMonitor = new AMLivelinessMonitor(dispatcher);
    AMLivelinessMonitor amFinishingMonitor = new AMLivelinessMonitor(dispatcher);
    RMDelegationTokenSecretManager delegationTokenSecretManager = new RMDelegationTokenSecretManager(1, 1, 1, 1, context);
    context = new MockRMContext();
    context.setStateStore(TestObjectFactory.getStateStore(conf, "tmp/myriad-operations-test"));
    context.setAmLivelinessMonitor(amLivelinessMonitor);
    context.setAmFinishingMonitor(amFinishingMonitor);
    context.setRMApplicationHistoryWriter(rmApplicationHistoryWriter);
    context.setRMDelegationTokenSecretManager(delegationTokenSecretManager);
    return context;
}
Also used : MockRMContext(org.apache.myriad.state.MockRMContext) Configuration(org.apache.hadoop.conf.Configuration) RMDelegationTokenSecretManager(org.apache.hadoop.yarn.server.resourcemanager.security.RMDelegationTokenSecretManager) AMLivelinessMonitor(org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor) MockDispatcher(org.apache.myriad.state.MockDispatcher) RMApplicationHistoryWriter(org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter) MockDispatcher(org.apache.myriad.state.MockDispatcher) Dispatcher(org.apache.hadoop.yarn.event.Dispatcher)

Aggregations

MockDispatcher (org.apache.myriad.state.MockDispatcher)2 Configuration (org.apache.hadoop.conf.Configuration)1 Dispatcher (org.apache.hadoop.yarn.event.Dispatcher)1 RMApplicationHistoryWriter (org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter)1 MyriadFileSystemRMStateStore (org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore)1 AMLivelinessMonitor (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AMLivelinessMonitor)1 RMDelegationTokenSecretManager (org.apache.hadoop.yarn.server.resourcemanager.security.RMDelegationTokenSecretManager)1 MockRMContext (org.apache.myriad.state.MockRMContext)1