Search in sources :

Example 1 with MyriadFileSystemRMStateStore

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore 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 MyriadFileSystemRMStateStore

use of org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore in project incubator-myriad by apache.

the class SchedulerStateResourceTest method getSchedulerState.

private SchedulerState getSchedulerState() throws Exception {
    SchedulerState state = new SchedulerState(new MyriadFileSystemRMStateStore());
    idOne = Protos.TaskID.newBuilder().setValue("nt-1").build();
    idTwo = Protos.TaskID.newBuilder().setValue("nt-2").build();
    idThree = Protos.TaskID.newBuilder().setValue("nt-3").build();
    TreeMap<String, Long> ports = new TreeMap<>();
    state.addTask(idOne, new NodeTask(new ServiceResourceProfile("profile1", 0.2, 1024.0, ports), new LikeConstraint("localhost", "host-[0-9]*.example.com")));
    state.addTask(idTwo, new NodeTask(new ServiceResourceProfile("profile2", 0.4, 2048.0, ports), new LikeConstraint("localhost", "host-[0-9]*.example.com")));
    state.addTask(idThree, new NodeTask(new ServiceResourceProfile("profile3", 0.6, 3072.0, ports), new LikeConstraint("localhost", "host-[0-9]*.example.com")));
    state.setFrameworkId(FrameworkID.newBuilder().setValue("mock-framework").build());
    state.makeTaskActive(idOne);
    state.makeTaskPending(idTwo);
    state.makeTaskStaging(idThree);
    return state;
}
Also used : SchedulerState(org.apache.myriad.state.SchedulerState) MyriadFileSystemRMStateStore(org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore) ServiceResourceProfile(org.apache.myriad.scheduler.ServiceResourceProfile) TreeMap(java.util.TreeMap) NodeTask(org.apache.myriad.state.NodeTask) LikeConstraint(org.apache.myriad.scheduler.constraints.LikeConstraint)

Aggregations

MyriadFileSystemRMStateStore (org.apache.hadoop.yarn.server.resourcemanager.recovery.MyriadFileSystemRMStateStore)2 TreeMap (java.util.TreeMap)1 ServiceResourceProfile (org.apache.myriad.scheduler.ServiceResourceProfile)1 LikeConstraint (org.apache.myriad.scheduler.constraints.LikeConstraint)1 MockDispatcher (org.apache.myriad.state.MockDispatcher)1 NodeTask (org.apache.myriad.state.NodeTask)1 SchedulerState (org.apache.myriad.state.SchedulerState)1