// projection1.setProjectionData(projectionData1);
ProjectionData projectionData1 = new ProjectionData(0, hosts1, null, "hosts", 0);
// HostsGridProjection projection1 = new HostsGridProjection(hosts1);
GridProjection projection1 = appmaster.createContainerCluster("cluster1", projectionData1).getGridProjection();
// cluster2
Map<String, Integer> hosts2 = new HashMap<String, Integer>();
hosts2.put("host20", 1);
// ProjectionData projectionData2 = new ProjectionData(0, hosts2, null);
// HostsGridProjection projection2 = new HostsGridProjection();
// projection2.setProjectionData(projectionData2);
// HostsGridProjection projection2 = new HostsGridProjection(hosts2);
ProjectionData projectionData2 = new ProjectionData(0, hosts2, null, "hosts", 0);
GridProjection projection2 = appmaster.createContainerCluster("cluster2", projectionData2).getGridProjection();
appmaster.startContainerCluster("cluster1");
assertDoTask(appmaster, 0, 1, 0, 0, "cluster1");
assertDoTask(appmaster, null, null, null, null, "cluster2");
appmaster.startContainerCluster("cluster2");
assertDoTask(appmaster, 0, 1, 0, 0, "cluster2");
assertDoTask(appmaster, null, null, null, null, "cluster1");
// allocate container 1
allocateContainer(appmaster, 1, "host10");
assertThat(projection1.getMembers().size() + projection2.getMembers().size(), is(1));
// assertDoTask(appmaster, null, null, null, null, "cluster1");
allocateContainer(appmaster, 2, "host20");
assertThat(projection1.getMembers().size() + projection2.getMembers().size(), is(2));
// assertDoTask(appmaster, null, null, null, null, "cluster1");
allocateContainer(appmaster, 3, "hostX1");
assertThat(projection1.getMembers().size(), is(1));
assertThat(projection2.getMembers().size(), is(1));
// modify - ramp up to 2
// appmaster.modifyContainerCluster("cluster1", new ProjectionData(2));
// assertDoTask(appmaster, 1, 0, 0, 0, "cluster1");