本文整理了Java中io.cattle.platform.core.model.Instance.getDeploymentUnitUuid()
方法的一些代码示例,展示了Instance.getDeploymentUnitUuid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getDeploymentUnitUuid()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getDeploymentUnitUuid
[英]Getter for cattle.instance.deployment_unit_uuid
.
[中]cattle.instance.deployment_unit_uuid
的Getter。
代码示例来源:origin: rancher/cattle
@Override
public boolean isServiceInstance(Instance instance) {
return instance.getDeploymentUnitUuid() != null;
}
代码示例来源:origin: rancher/cattle
protected void addInstanceToDeploymentUnits(Map<String, List<Instance>> deploymentUnitInstancesToUpgrade,
Instance instance) {
List<Instance> toRemove = deploymentUnitInstancesToUpgrade.get(instance.getDeploymentUnitUuid());
if (toRemove == null) {
toRemove = new ArrayList<>();
}
toRemove.add(instance);
deploymentUnitInstancesToUpgrade.put(instance.getDeploymentUnitUuid(), toRemove);
}
代码示例来源:origin: rancher/cattle
protected List<Instance> getInstancesToAllocate(Instance instance) {
if (instance.getDeploymentUnitUuid() != null) {
return allocatorDao.getUnmappedDeploymentUnitInstances(instance.getDeploymentUnitUuid());
} else {
List<Instance> instances = new ArrayList<>();
instances.add(instance);
return instances;
}
}
代码示例来源:origin: rancher/cattle
public Condition getInstanceHostConstraint(Instance instance) {
if (StringUtils.isEmpty(instance.getDeploymentUnitUuid())) {
return INSTANCE_HOST_MAP.INSTANCE_ID.eq(instance.getId());
} else {
return INSTANCE.DEPLOYMENT_UNIT_UUID.eq(instance.getDeploymentUnitUuid());
}
}
代码示例来源:origin: rancher/cattle
@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
Instance instance = (Instance) state.getResource();
if (instance.getDeploymentUnitUuid() == null) {
return null;
}
List<Instance> dependants = objectManager.find(Instance.class, INSTANCE.REMOVED, null,
INSTANCE.DEPLOYMENT_UNIT_UUID, instance.getDeploymentUnitUuid(), INSTANCE.NETWORK_CONTAINER_ID,
instance.getId());
if (dependants.isEmpty()) {
return null;
}
List<String> invalidStates = Arrays.asList(CommonStatesConstants.REMOVING, InstanceConstants.STATE_ERROR,
InstanceConstants.STATE_ERRORING, InstanceConstants.STATE_STOPPING, InstanceConstants.STATE_STOPPED);
for (Instance dependant : dependants) {
if (!invalidStates.contains(dependant.getState())) {
objectProcessManager.scheduleProcessInstance(InstanceConstants.PROCESS_STOP, dependant, null);
}
}
return null;
}
}
代码示例来源:origin: rancher/cattle
protected void waitForDeploymentUnitCreate(Instance instance) {
if(StringUtils.isEmpty(instance.getDeploymentUnitUuid())) {
return;
instanceDao.findUnallocatedInstanceByDeploymentUnitUuid(instance.getAccountId(), instance.getDeploymentUnitUuid());
代码示例来源:origin: rancher/cattle
protected LockDefinition getInstanceLockDef(Instance origInstance, List<Instance> instances, Set<Long> volumeIds) {
List<LockDefinition> locks = allocationHelper.extractAllocationLockDefinitions(origInstance, instances);
if (origInstance.getDeploymentUnitUuid() != null) {
locks.add(new AllocateConstraintLock(AllocateConstraintLock.Type.DEPLOYMENT_UNIT, origInstance.getDeploymentUnitUuid()));
代码示例来源:origin: rancher/cattle
setStartCount(from.getStartCount());
setCreateIndex(from.getCreateIndex());
setDeploymentUnitUuid(from.getDeploymentUnitUuid());
setVersion(from.getVersion());
setHealthUpdated(from.getHealthUpdated());
内容来源于网络,如有侵权,请联系作者删除!