rawlinp commented on a change in pull request #2785: In Traffic Router Support 
Snapshots which only update Delivery Services
URL: https://github.com/apache/trafficcontrol/pull/2785#discussion_r290066352
 
 

 ##########
 File path: 
traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/dns/ZoneManager.java
 ##########
 @@ -115,14 +117,90 @@ public ZoneManager(final TrafficRouter tr, final 
StatTracker statTracker, final
                this.statTracker = statTracker;
        }
 
+       ZoneManager( final TrafficRouter trafficRouter,  final StatTracker 
statTracker) {
+               this.trafficRouter = trafficRouter;
+               this.statTracker = statTracker;
+       }
+
        public static void destroy() {
                zoneMaintenanceExecutor.shutdownNow();
                zoneExecutor.shutdownNow();
-               signatureManager.destroy();
+               getSignatureManager().destroy();
+       }
+
+       /**
+        * Use this factory method when Traffic Router is being initialized or 
in cases when the zone
+        * caches need to be completely rebuilt.
+        * @param tr The TrafficRouter instance containing a prepared 
CacheRegister
+        * @param statTracker A StatsTracker instance for tracking statistics
+        * @param trafficOpsUtils
+        * @param trafficRouterManager The TrafficRouterManager which will 
eventually be managing the
+        *                             TrafficRouter instance 'tr'.
+        * @return a new instance of a ZoneManager with zone caches fully 
populated
+        * @throws IOException
+        */
+       public static ZoneManager initialInstance(final TrafficRouter tr, final 
StatTracker statTracker,
+                               final TrafficOpsUtils trafficOpsUtils,
+                            final TrafficRouterManager trafficRouterManager) 
throws IOException {
+               return new ZoneManager( tr, statTracker, trafficOpsUtils, 
trafficRouterManager);
        }
 
-       protected void rebuildZoneCache() {
-               initZoneCache(trafficRouter);
+       /**
+        * Use this factory only to make changes to the zone caches and 
retrieve an associated ZoneManager. The
+        * initialInstance method should have already been called at least once 
previously.
+        * @param tr The TrafficRouter instance containing a CacheRegister 
prepared with the changes cooresponding
+        *           to the changes that will be made in the zone caches.
+        * @param statTracker A StatsTracker instance for tracking statistics
+        * @param sep The SnapshotEventsProcessor containing the events 
representing the changes to be
+        *            made to the zone caches
+        * @return
+        * @throws IOException
+        */
+       public static ZoneManager snapshotInstance( final TrafficRouter tr, 
final StatTracker statTracker,
+        final SnapshotEventsProcessor sep) throws IOException {
 
 Review comment:
   formatting is off

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