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

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

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

Instance.getNetworkContainerId介绍

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

代码示例

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

@Override
public void appendConstraints(AllocationAttempt attempt, AllocationLog log, List<Constraint> constraints) {
  for (Instance instance : attempt.getInstances()) {
    String networkMode = DataAccessor.fields(instance).withKey(DockerInstanceConstants.FIELD_NETWORK_MODE).as(String.class);
    if (NetworkConstants.NETWORK_MODE_CONTAINER.equals(networkMode) && instance.getNetworkContainerId() != null) {
      Long containerId = instance.getNetworkContainerId();
      Set<Long> containerIds = new HashSet<Long>();
      containerIds.add(containerId);
      Map<Long, Set<Long>> hostsToInstances = checkAndGetCollocatedInstanceHosts(containerIds, attempt.getInstances());
      for (Map.Entry<Long, Set<Long>> hostToInstances : hostsToInstances.entrySet()) {
        constraints.add(new CollocationConstraint(hostToInstances.getKey(), hostToInstances.getValue()));
      }
    }
  }
}

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

protected void waitForDependenciesStart(Instance instance) {
  List<Long> instancesIds = DataAccessor.fieldLongList(instance, DockerInstanceConstants.FIELD_VOLUMES_FROM);
  Long networkFromId = instance.getNetworkContainerId();
  if (networkFromId != null) {
    instancesIds.add(networkFromId);

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

setExternalId(from.getExternalId());
setNativeContainer(from.getNativeContainer());
setNetworkContainerId(from.getNetworkContainerId());
setHealthState(from.getHealthState());
setStartCount(from.getStartCount());

相关文章