io.cattle.platform.core.model.Instance.getServiceIndexId()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中io.cattle.platform.core.model.Instance.getServiceIndexId()方法的一些代码示例,展示了Instance.getServiceIndexId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getServiceIndexId()方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getServiceIndexId

Instance.getServiceIndexId介绍

[英]Getter for cattle.instance.service_index_id.
[中]cattle.instance.service_index_id的Getter。

代码示例

代码示例来源:origin: rancher/cattle

@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);
    }
  }
}

代码示例来源:origin: rancher/cattle

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);
}

代码示例来源:origin: rancher/cattle

if (objectDisks instanceof List<?>) {
  String namePrefix = instance.getName();
  Long svcIndexId = instance.getServiceIndexId();

代码示例来源:origin: rancher/cattle

setVersion(from.getVersion());
setHealthUpdated(from.getHealthUpdated());
setServiceIndexId(from.getServiceIndexId());
setDnsInternal(from.getDnsInternal());
setDnsSearchInternal(from.getDnsSearchInternal());

相关文章