use of org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx in project incubator-servicecomb-java-chassis by apache.
the class OperationInstancesDiscoveryFilter method initOperationNodes.
protected Map<String, DiscoveryTreeNode> initOperationNodes(DiscoveryTreeNode parent, Map<MicroserviceVersionMeta, Map<String, MicroserviceInstance>> versionMap) {
Map<String, DiscoveryTreeNode> tmpChildren = new ConcurrentHashMapEx<>();
versionMap.keySet().stream().sorted(Comparator.comparing(MicroserviceVersion::getVersion)).forEach(meta -> {
for (OperationMeta operationMeta : meta.getMicroserviceMeta().getOperations()) {
tmpChildren.computeIfAbsent(operationMeta.getMicroserviceQualifiedName(), qualifiedName -> {
VersionRule versionRule = VersionRuleUtils.getOrCreate(meta.getVersion().getVersion() + "+");
return new DiscoveryTreeNode().attribute(VERSION_RULE, versionRule).subName(parent, versionRule.getVersionRule()).data(new HashMap<>());
});
}
});
return tmpChildren;
}
Aggregations