This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 36eee10a05bd3dcfc9307943b3f4d216f6eca22c
Author: Jesse Rivas <jesse_ri...@comcast.com>
AuthorDate: Thu Feb 22 08:38:52 2018 -0700

    Updated configuration.rst and renamed defaultGeolocations
---
 docs/source/admin/traffic_ops/configuration.rst                   | 1 +
 .../traffic_control/traffic_router/core/router/TrafficRouter.java | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/docs/source/admin/traffic_ops/configuration.rst 
b/docs/source/admin/traffic_ops/configuration.rst
index ab77a50..c63a5ec 100644
--- a/docs/source/admin/traffic_ops/configuration.rst
+++ b/docs/source/admin/traffic_ops/configuration.rst
@@ -159,6 +159,7 @@ Many of the settings for the different servers in a Traffic 
Control CDN are cont
 | geolocation6.polling.url | CRConfig.json | The location to get the IPv6 
GeoLiteCity database from.                                                      
                         |
 
+--------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------+
 | maxmind.default.override | CRConfig.json | The destination geo coordinates 
to use for client location when maxmind returns a default location that matches 
the country code.     |
+|                          |               | This parameter can be specified 
multiple times with different values to support default overrides for multiple 
countries.             |
 |                          |               | Format: 
<CountryCode>;<Lat>,<Long>   Ex: US;37.751,-97.822                              
                                              |
 
+--------------------------+---------------+---------------------------------------------------------------------------------------------------------------------------------------+
 
diff --git 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index 336bf4d..da05a5c 100644
--- 
a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ 
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -87,7 +87,7 @@ public class TrafficRouter {
        private final ConsistentHasher consistentHasher = new 
ConsistentHasher();
        private SteeringRegistry steeringRegistry;
 
-       private final Map<String, Geolocation> defaultGeolocations = new 
HashMap<String, Geolocation>();
+       private final Map<String, Geolocation> defaultGeolocationsOverride = 
new HashMap<String, Geolocation>();
 
        public TrafficRouter(final CacheRegister cr, 
                        final GeolocationService geolocationService, 
@@ -111,7 +111,7 @@ public class TrafficRouter {
                                        final String countryCode = 
JsonUtils.optString(geolocation, "countryCode");
                                        final double lat = 
JsonUtils.optDouble(geolocation, "lat");
                                        final double longitude = 
JsonUtils.optDouble(geolocation, "long");
-                                       defaultGeolocations.put(countryCode, 
new Geolocation(lat, longitude));
+                                       
defaultGeolocationsOverride.put(countryCode, new Geolocation(lat, longitude));
                                }
                        }
                }
@@ -325,8 +325,8 @@ public class TrafficRouter {
                        }
                }
 
-               if (clientLocation.isDefaultLocation() && 
defaultGeolocations.containsKey(clientLocation.getCountryCode())) {
-                       clientLocation = 
defaultGeolocations.get(clientLocation.getCountryCode());
+               if (clientLocation.isDefaultLocation() && 
defaultGeolocationsOverride.containsKey(clientLocation.getCountryCode())) {
+                       clientLocation = 
defaultGeolocationsOverride.get(clientLocation.getCountryCode());
                }
 
                final List<Cache> caches = getCachesByGeo(deliveryService, 
clientLocation, track);

-- 
To stop receiving notification emails like this one, please contact
els...@apache.org.

Reply via email to