sanpwc commented on code in PR #2415:
URL: https://github.com/apache/ignite-3/pull/2415#discussion_r1305582460


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -1945,29 +1365,84 @@ public Set<NodeWithAttributes> logicalTopology() {
         return logicalTopology;
     }
 
-    /**
-     * Returns the distribution zone name from the configuration, {@code null} 
if the zone is absent.
-     *
-     * @param configZoneId Distribution zone id from configuration.
-     */
-    // TODO: IGNITE-20114 Get rid of
-    @Deprecated(forRemoval = true)
-    public @Nullable String getZoneName(int configZoneId) {
-        DistributionZonesView zonesView = zonesConfiguration.value();
-
-        return Stream.concat(Stream.of(zonesView.defaultDistributionZone()), 
zonesView.distributionZones().stream())
-                .filter(zoneView -> zoneView.zoneId() == configZoneId)
-                .map(DistributionZoneView::name)
-                .findFirst()
-                .orElse(null);
+    private void registerCatalogEventListenersOnStartManagerBusy() {
+        catalogManager.listen(ZONE_CREATE, (parameters, exception) -> 
inBusyLock(busyLock, () -> {
+            assert exception == null : parameters;
+
+            CreateZoneEventParameters params = (CreateZoneEventParameters) 
parameters;
+
+            createOrRestoreZoneStateBusy(params.zoneDescriptor(), 
params.causalityToken());
+
+            return completedFuture(false);
+        }));
+
+        catalogManager.listen(ZONE_DROP, (parameters, exception) -> 
inBusyLock(busyLock, () -> {
+            assert exception == null : parameters;
+
+            onDropZoneBusy((DropZoneEventParameters) parameters);
+
+            return completedFuture(false);
+        }));
+
+        catalogManager.listen(ZONE_ALTER, new 
ManagerCatalogAlterZoneEventListener());
+    }
+
+    private void startZonesOnStartManagerBusy() {
+        CompletableFuture<Long> recoveryFinishedFuture = 
metaStorageManager.recoveryFinishedFuture();
+
+        assert recoveryFinishedFuture.isDone();
+
+        int catalogVersion = catalogManager.latestCatalogVersion();

Review Comment:
   Is it possible for latestCatalogVersion to be increased during DZM startup 
or it might be considered as an immutable value during startup period?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to