/**
* Assemble watch keys for the given appId, cluster, namespaces, dataCenter combination
*
* @return a multimap with namespace as the key and watch keys as the value
*/
public Multimap<String, String> assembleAllWatchKeys(String appId, String clusterName,
Set<String> namespaces,
String dataCenter) {
Multimap<String, String> watchedKeysMap =
assembleWatchKeys(appId, clusterName, namespaces, dataCenter);
//Every app has an 'application' namespace
if (!(namespaces.size() == 1 && namespaces.contains(ConfigConsts.NAMESPACE_APPLICATION))) {
Set<String> namespacesBelongToAppId = namespacesBelongToAppId(appId, namespaces);
Set<String> publicNamespaces = Sets.difference(namespaces, namespacesBelongToAppId);
//Listen on more namespaces if it's a public namespace
if (!publicNamespaces.isEmpty()) {
watchedKeysMap
.putAll(findPublicConfigWatchKeys(appId, clusterName, publicNamespaces, dataCenter));
}
}
return watchedKeysMap;
}
WatchKeysUtil.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:apollo-custom
作者:
评论列表
文章目录