rawlinp commented on a change in pull request #1908: Changes for Backup Edge 
Cache Group
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1908#discussion_r172958519
 
 

 ##########
 File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 ##########
 @@ -262,7 +264,8 @@ public Geolocation getLocation(final String clientIP, 
final DeliveryService deli
                        }
                } else {
                        // Deep caching not enabled for this Delivery Service; 
use the regular CZ
-                       cacheLocation = 
getCoverageZoneCacheLocation(request.getClientIP(), ds);
+                       cacheLocation = 
getCoverageZoneCacheLocation(request.getClientIP(), ds, track, useDeep);
+                       networkNode = getNetworkNode(request.getClientIP());
 
 Review comment:
   Generally I'm not a big fan of polluting this method with extra NetworkNode 
stuff, especially since `getNetworkNode` is already called in 
`getCoverageZoneCacheLocation`. I think ideally `getCoverageZoneCacheLocation` 
should return us the information we need.
   
   Since we're passing in the `Track` object, we could probably add that 
information there, ie something like `track.noBackupLocationsAvailable()` which 
would get set within `getCoverageZoneCacheLocation`. Then we can update the 
logic starting on L277 to something like this:
   ```
   if (track.noBackupLocationsAvailable() or ds.isCoverageZoneOnly()) { 
       if (ds.geoRedirect) {...}
       else {
           resultDetails = DS_CZ_ONLY if ds.isCoverageZoneOnly else DS_CZ_NO_BKP
           ...
       }
   }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to