private void writeDeploymentUnitStatus(DeploymentUnitType type, String name,
			DeploymentUnitStatus status) throws Exception {
		CuratorFramework client = zkConnection.getClient();
		logger.info("Deployment status for {} '{}': {}", type, name, status);

		String statusPath = Paths.build(
				type == DeploymentUnitType.Stream
						? Paths.STREAM_DEPLOYMENTS
						: Paths.JOB_DEPLOYMENTS,
				name, Paths.STATUS);
		Stat stat = client.checkExists().forPath(statusPath);
		if (stat != null) {
			logger.trace("Found old status path {}; stat: {}", statusPath, stat);
			client.delete().forPath(statusPath);
		}
		client.create().withMode(CreateMode.EPHEMERAL).forPath(statusPath,
				ZooKeeperUtils.mapToBytes(status.toMap()));
	}
Write the deployment status of the deployment unit.

@param type    deployment unit type
@param name    deployment unit name
@param status  deployment unit status
@throws Exception
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/admin/deployment/zk/DefaultDeploymentStateRecalculator.java