当前位置: 首页>>代码示例>>Java>>正文


Java DeploymentState.deployed方法代码示例

本文整理汇总了Java中org.springframework.cloud.deployer.spi.app.DeploymentState.deployed方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentState.deployed方法的具体用法?Java DeploymentState.deployed怎么用?Java DeploymentState.deployed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.cloud.deployer.spi.app.DeploymentState的用法示例。


在下文中一共展示了DeploymentState.deployed方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isHealthy

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
public boolean isHealthy(Release replacingRelease) {
	AppDeployerData replacingAppDeployerData = this.appDeployerDataRepository
			.findByReleaseNameAndReleaseVersionRequired(
					replacingRelease.getName(), replacingRelease.getVersion());

	Map<String, String> appNamesAndDeploymentIds = replacingAppDeployerData.getDeploymentDataAsMap();

	AppDeployer appDeployer = this.deployerRepository
			.findByNameRequired(replacingRelease.getPlatformName())
			.getAppDeployer();

	logger.debug("Getting status for apps in replacing release {}-v{}", replacingRelease.getName(),
			replacingRelease.getVersion());
	for (Map.Entry<String, String> appNameAndDeploymentId : appNamesAndDeploymentIds.entrySet()) {
		AppStatus status = appDeployer.status(appNameAndDeploymentId.getValue());
		if (status.getState() == DeploymentState.deployed) {
			return true;
		}
	}

	return false;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:23,代码来源:HealthCheckStep.java

示例2: getState

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
@Override
public DeploymentState getState() {
	if (task == null) {
		if (app.getLastTaskFailure() == null) {
			return DeploymentState.unknown;
		}
		else {
			return DeploymentState.failed;
		}
	}
	else {
		if (app.getInstances().intValue() > app.getTasksRunning().intValue()) {
			return DeploymentState.deploying;
		}
		else {
			Collection<HealthCheckResult> healthCheckResults = task.getHealthCheckResults();
			boolean alive = healthCheckResults != null && healthCheckResults.iterator().next().isAlive();
			if (!alive && app.getLastTaskFailure() != null) {
				return DeploymentState.failed;
			}
			return alive ? DeploymentState.deployed : DeploymentState.deploying;
		}
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-mesos,代码行数:25,代码来源:MarathonAppInstanceStatus.java

示例3: getState

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
@Override
public DeploymentState getState() {
	if (instanceDetail == null) {
		return DeploymentState.failed;
	}
	switch (instanceDetail.getState()) {
		case "STARTING":
		case "DOWN":
			return DeploymentState.deploying;
		case "CRASHED":
			return DeploymentState.failed;
		// Seems the client incorrectly reports apps as FLAPPING when they are
		// obviously fine. Mapping as RUNNING for now
		case "FLAPPING":
		case "RUNNING":
			return DeploymentState.deployed;
		case "UNKNOWN":
			return DeploymentState.unknown;
		default:
			throw new IllegalStateException("Unsupported CF state: " + instanceDetail.getState());
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:23,代码来源:CloudFoundryAppInstanceStatus.java

示例4: deployStream

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
@Override
public void deployStream(String name, Map<String, String> deploymentProperties) {
	if (deploymentProperties == null) {
		deploymentProperties = new HashMap<>();
	}
	StreamDefinition streamDefinition = this.streamDefinitionRepository.findOne(name);
	if (streamDefinition == null) {
		throw new NoSuchStreamDefinitionException(name);
	}

	DeploymentState status = this.doCalculateStreamState(name);

	if (DeploymentState.deployed == status) {
		throw new StreamAlreadyDeployedException(name);
	}
	else if (DeploymentState.deploying  == status) {
		throw new StreamAlreadyDeployingException(name);
	}
	doDeployStream(streamDefinition, deploymentProperties);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:21,代码来源:AbstractStreamService.java

示例5: aggregateState

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
/**
 * Aggregate the set of app states into a single state for a stream.
 *
 * @param states set of states for apps of a stream
 * @return the stream state based on app states
 */
public static DeploymentState aggregateState(List<DeploymentState> states) {
	if (states.size() == 1) {
		DeploymentState state = states.iterator().next();
		logger.debug("aggregateState: Deployment State Set Size = 1.  Deployment State " + state);
		// a stream which is known to the stream definition repository
		// but unknown to deployers is undeployed
		if (state == DeploymentState.unknown) {
			logger.debug("aggregateState: Returning " + DeploymentState.undeployed);
			return DeploymentState.undeployed;
		}
		else {
			logger.debug("aggregateState: Returning " + state);
			return state;
		}
	}
	if (states.isEmpty() || states.contains(DeploymentState.error)) {
		logger.debug("aggregateState: Returning " + DeploymentState.error);
		return DeploymentState.error;
	}
	if (states.contains(DeploymentState.failed)) {
		logger.debug("aggregateState: Returning " + DeploymentState.failed);
		return DeploymentState.failed;
	}
	if (states.contains(DeploymentState.deploying)) {
		logger.debug("aggregateState: Returning " + DeploymentState.deploying);
		return DeploymentState.deploying;
	}

	if (allAppsDeployed(states)) {
		return DeploymentState.deployed;
	}

	logger.debug("aggregateState: Returning " + DeploymentState.partial);
	return DeploymentState.partial;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:42,代码来源:ReleaseCommands.java

示例6: allAppsDeployed

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
private static boolean allAppsDeployed(List<DeploymentState> deploymentStateList) {
	boolean allDeployed = true;
	for (DeploymentState deploymentState : deploymentStateList) {
		if (deploymentState != DeploymentState.deployed) {
			allDeployed = false;
			break;
		}
	}
	return allDeployed;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:11,代码来源:ReleaseCommands.java

示例7: allAppsDeployed

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
protected boolean allAppsDeployed(List<AppStatus> appStatusList) {
	boolean allDeployed = true;
	for (AppStatus appStatus : appStatusList) {
		if (appStatus.getState() != DeploymentState.deployed) {
			allDeployed = false;
			break;
		}
	}
	return allDeployed;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:11,代码来源:AbstractAssertReleaseDeployedTest.java

示例8: ContainerReady

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
ContainerReady(KubernetesDeployerProperties properties) {
	super(properties, DeploymentState.deployed, new ContainerStatusCondition("container ready") {
		@Override
		public boolean test(ContainerStatus containerStatus) {
			return containerStatus.getReady();
		}
	});
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-kubernetes,代码行数:9,代码来源:PredicateRunningPhaseDeploymentStateResolver.java

示例9: mapShallowAppState

import org.springframework.cloud.deployer.spi.app.DeploymentState; //导入方法依赖的package包/类
private DeploymentState mapShallowAppState(ApplicationSummary applicationSummary) {
	if (applicationSummary.getRunningInstances().equals(applicationSummary.getInstances())) {
		return DeploymentState.deployed;
	}
	else if (applicationSummary.getInstances() > 0) {
		return DeploymentState.partial;
	} else {
		return DeploymentState.undeployed;
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:11,代码来源:CloudFoundryAppDeployer.java


注:本文中的org.springframework.cloud.deployer.spi.app.DeploymentState.deployed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。