use of org.apache.hadoop.yarn.event.Dispatcher in project hadoop by apache.
the class TestNMWebServicesApps method addAppContainers.
private HashMap<String, String> addAppContainers(Application app) throws IOException {
Dispatcher dispatcher = new AsyncDispatcher();
ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(app.getAppId(), 1);
Container container1 = new MockContainer(appAttemptId, dispatcher, conf, app.getUser(), app.getAppId(), 1);
Container container2 = new MockContainer(appAttemptId, dispatcher, conf, app.getUser(), app.getAppId(), 2);
nmContext.getContainers().put(container1.getContainerId(), container1);
nmContext.getContainers().put(container2.getContainerId(), container2);
app.getContainers().put(container1.getContainerId(), container1);
app.getContainers().put(container2.getContainerId(), container2);
HashMap<String, String> hash = new HashMap<String, String>();
hash.put(container1.getContainerId().toString(), container1.getContainerId().toString());
hash.put(container2.getContainerId().toString(), container2.getContainerId().toString());
return hash;
}
Aggregations