You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/02/20 17:06:04 UTC

[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #4409: Optimize TR DNSSEC zone re-signing

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

 ##########
 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:
   Any reason `s` can't be an `int`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services