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;
}
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;
}
Aggregations