rawlinp commented on a change in pull request #4409: Optimize TR DNSSEC zone 
re-signing
URL: https://github.com/apache/trafficcontrol/pull/4409#discussion_r382153635
 
 

 ##########
 File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java
 ##########
 @@ -240,6 +247,34 @@ protected static void initZoneCache(final TrafficRouter 
tr) {
                }
        }
 
+       private static void copyExistingDynamicZones(final TrafficRouter tr, 
final LoadingCache<ZoneKey, Zone> dzc) {
+               final Map<String, DeliveryService> allZones = 
getAllDeliveryServiceDomains(tr);
+               allZones.put(getTopLevelDomain().toString(true), null);
+               final Map<ZoneKey, Zone> dzcMap = dynamicZoneCache.asMap();
+               for (final ZoneKey zoneKey : dzcMap.keySet()) {
+                       if 
(allZones.containsKey(zoneKey.getName().toString(true))) {
+                               dzc.put(zoneKey, dzcMap.get(zoneKey));
+                       } else {
+                               LOGGER.info("domain for old zone " + 
zoneKey.getName().toString(true) + " not found; will not copy it into new 
dynamic zone cache");
+                       }
+               }
+       }
+
+       private static int calcThreadPoolSize(final JsonNode config) {
+               int poolSize = 1;
+               final double scale = JsonUtils.optDouble(config, 
"zonemanager.threadpool.scale", 0.75);
+               final int cores = Runtime.getRuntime().availableProcessors();
+
+               if (cores > 2) {
+                       final Double s = Math.floor((double) cores * scale);
 
 Review comment:
   I didn't write this code I just refactored it into its own method, but here 
`scale` is double which is why I'm guessing it was done this way. I'd rather 
not rework existing code unless there is a good reason to.

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


With regards,
Apache Git Services

Reply via email to