zrhoffman commented on a change in pull request #4724:
URL: https://github.com/apache/trafficcontrol/pull/4724#discussion_r442535187



##########
File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
##########
@@ -491,21 +491,36 @@ private void parseTopologyConfig(final JsonNode 
allTopologies, final Map<String,
 
                deliveryServiceMap.forEach((xmlId, ds) -> {
                        final List<DeliveryServiceReference> dsReferences = new 
ArrayList<>();
+                       final List<String> dsNames = new ArrayList<>(); // for 
stats
                        Stream.of(ds.getTopology())
-                                       .filter((topologyName) -> 
!Objects.isNull(topologyName) && topologyMap.containsKey(topologyName))
-                                       .flatMap((topologyName) -> 
topologyMap.get(topologyName).stream())
-                                       .flatMap((node) -> 
cacheRegister.getCacheLocation(node).getCaches().stream())
-                                       .filter((cache) -> 
ds.hasRequiredCapabilities(cache.getCapabilities()))
-                                       .forEach((cache) -> {
+                                       .filter(topologyName -> 
!Objects.isNull(topologyName) && topologyMap.containsKey(topologyName))
+                                       .flatMap(topologyName -> {
+                                               statMap.put(ds.getId(), 
dsNames);
+                                               return 
topologyMap.get(topologyName).stream();
+                                       })
+                                       .flatMap(node -> 
cacheRegister.getCacheLocation(node).getCaches().stream())
+                                       .filter(cache -> 
ds.hasRequiredCapabilities(cache.getCapabilities()))
+                                       .forEach(cache -> {
+                                           
cacheRegister.getDeliveryServiceMatchers(ds).stream()
+                                                               
.flatMap(deliveryServiceMatcher -> 
deliveryServiceMatcher.getRequestMatchers().stream())
+                                                               
.map(requestMatcher -> requestMatcher.getPattern().pattern())
+                                                               
.forEach(pattern -> {
+                                                                       final 
String remap = ds.getRemap(pattern);
+                                                                       final 
String fqdn = pattern.contains(".*") && !ds.isDns()
+                                                                               
        ? cache.getId() + "." + remap
+                                                                               
        : remap;
+                                                                       
dsNames.add(getDsName(fqdn, tld));
+                                                                       try {
+                                                                               
dsReferences.add(new DeliveryServiceReference(ds.getId(), fqdn));

Review comment:
       Not creating `DeliveryServiceReference`s for aliases in 2e509d420 (but 
still adding them to `statMap`).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to