HostGroupData hostGroupData = hostGroups.get(hostData.getHostGroup());
if (hostGroupData == null) {
throw new IllegalStateException();
}
DatacenterManager datacenter = datacenters.get(hostGroupData.getId());
if (datacenter == null) {
switch (hostGroupData.getHostGroupType()) {
case HOST_GROUP_TYPE_RAW:
datacenter = new RawDatacenterManager();
break;