@Override protected void populatedData(Account system, List<Object> toCreate) { List<Instance> instances = objectManager .find(Instance.class, INSTANCE.REMOVED, new Condition(ConditionType.NULL)); List<ServiceIndex> serviceIndexes = objectManager .find(ServiceIndex.class, SERVICE_INDEX.REMOVED, new Condition(ConditionType.NULL)); Map<Long, ServiceIndex> serviceIndexIdsToIndexes = new HashMap<>(); for (ServiceIndex index : serviceIndexes) { serviceIndexIdsToIndexes.put(index.getId(), index); } for (Instance instance : instances) { Long indexId = instance.getServiceIndexId(); if (indexId == null) { continue; } ServiceIndex index = serviceIndexIdsToIndexes.get(indexId); if (index == null) { continue; } Map<String, Object> data = new HashMap<>(); data.put(InstanceConstants.FIELD_SERVICE_INSTANCE_SERVICE_INDEX, index.getServiceIndex()); objectManager.setFields(instance, data); } } }
public DefaultDeploymentUnitInstance(DeploymentServiceContext context, String uuid, Service service, String instanceName, Instance instance, String launchConfigName) { super(context, uuid, service, launchConfigName); this.instanceName = instanceName; this.instance = instance; if (this.instance != null) { exposeMap = context.exposeMapDao.findInstanceExposeMap(this.instance); Long svcIndexId = instance.getServiceIndexId(); if (svcIndexId != null) { serviceIndex = context.objectManager .loadResource(ServiceIndex.class, svcIndexId); } } else { this.serviceIndex = createServiceIndex(); } setStartOnce(service, launchConfigName); }
if (objectDisks instanceof List<?>) { String namePrefix = instance.getName(); Long svcIndexId = instance.getServiceIndexId();
setVersion(from.getVersion()); setHealthUpdated(from.getHealthUpdated()); setServiceIndexId(from.getServiceIndexId()); setDnsInternal(from.getDnsInternal()); setDnsSearchInternal(from.getDnsSearchInternal());