return EnumSet.allOf(CrawlerTypes.class);
}
@Override
public List<InstanceGroup> groups() {
InstanceGroup gA0 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name0", "reg1", "0:i-123456780");
InstanceGroup gA1 = new TestInstanceGroup(CrawlerTypes.TYPE_A, "name1", "reg1", "1:i-123456781");
InstanceGroup gB2 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name2", "reg1", "2:i-123456782");
InstanceGroup gB3 = new TestInstanceGroup(CrawlerTypes.TYPE_B, "name3", "reg1", "3:i-123456783");
InstanceGroup gC1 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name4", "reg1", "3:i-123456784",
"3:i-123456785");
InstanceGroup gC2 = new TestInstanceGroup(CrawlerTypes.TYPE_C, "name5", "reg1", "3:i-123456786",
"3:i-123456787");
InstanceGroup gD0 = new TestInstanceGroup(CrawlerTypes.TYPE_D, "new-group-TestGroup1-XXXXXXXXX",
"reg1", "3:i-123456786", "3:i-123456787");
return Arrays.asList(gA0, gA1, gB2, gB3, gC1, gC2, gD0);
}
@Override
public List<InstanceGroup> groups(String... names) {
Map<String, InstanceGroup> nameToGroup = new HashMap<String, InstanceGroup>();
for (InstanceGroup ig : groups()) {
nameToGroup.put(ig.name(), ig);
}
List<InstanceGroup> list = new LinkedList<InstanceGroup>();
for (String name : names) {
InstanceGroup ig = nameToGroup.get(name);
if (ig == null) {
continue;
}
for (String instanceId : selected) {
// Remove selected instances from crawler list