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



##########
File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java
##########
@@ -454,6 +476,31 @@ private void parseCacheConfig(final JsonNode 
contentServers, final CacheRegister
                return deliveryServiceMap;
        }
 
+       private void parseTopologyConfig(final JsonNode allTopologies, final 
Map<String, DeliveryService> deliveryServiceMap, final CacheRegister 
cacheRegister) {
+               final Map<String, List<String>> topologyMap = new HashMap<>();
+               allTopologies.fieldNames().forEachRemaining((String 
topologyName) -> {
+                       final List<String> nodes = new ArrayList<>();
+                       
allTopologies.get(topologyName).get("nodes").forEach((JsonNode cache) -> 
nodes.add(cache.textValue()));
+                       topologyMap.put(topologyName, nodes);
+               });
+
+               deliveryServiceMap.forEach((xmlId, ds) -> {
+                       final List<DeliveryServiceReference> dsReferences = new 
ArrayList<>();
+                       try {
+                               dsReferences.add(new 
DeliveryServiceReference(ds.getId(), ds.getDomain()));

Review comment:
       So I think that covers the "normal" use case, where a delivery service 
doesn't have any "vanity URLs" -- created via adding another HOST_REGEXP with 
set > 0, e.g. foo.example.com -- but does it handle the Vanity URL use case?
   
   Say my "normal" URL is cdn.myds.cdn.example.com (xml ID is "myds"), if you 
add another HOST_REGEXP value "foo.example.com" with order = 1, 
"foo.example.com" becomes the Vanity URL. This works by having the 
foo.example.com CNAME to cdn.myds.cdn.example.com. So the `Host` client header 
that TR sees is "foo.example.com", and it needs to match that URL to the "myds" 
delivery service somehow.
   
   Looking closely at 
https://github.com/apache/trafficcontrol/blob/master/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/config/ConfigHandler.java#L398-L408
 though, it looks like really pertains to `statMap` handling, which makes me 
think we'll probably _route_ the request fine, but it might not be counted for 
the right DS in that `statsMap`? That `statsMap` stuff should be 
http://localhost:3333/crs/stats by the way.




----------------------------------------------------------------
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