@Override
	public long count() {
		long count = 0;
		try {
			List<String> containerIds = zkConnection.getClient().getChildren().forPath(Paths.MODULE_DEPLOYMENTS);
			for (String containerId : containerIds) {
				Stat stat = zkConnection.getClient().checkExists().forPath(containerAllocationPath(containerId));
				if (stat != null) {
					count+= stat.getNumChildren();
				}
			}
		}
		catch (Exception e) {
			throw ZooKeeperUtils.wrapThrowable(e);
		}
		return count;
	}
Get all the deployed modules by the given containerId.

@param containerId the containerId to filter
@return the list of moduleIds of the deployed modules.
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/store/ZooKeeperModuleMetadataRepository.java