sanpwc commented on code in PR #2253:
URL: https://github.com/apache/ignite-3/pull/2253#discussion_r1243957628
##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DistributionZoneManager.java:
##########
@@ -798,15 +787,81 @@ public CompletableFuture<?>
onDelete(ConfigurationNotificationEvent<Distribution
}
/**
- * Method updates data nodes value for the specified zone, also sets
{@code revision} to the
- * {@link DistributionZonesUtil#zoneScaleUpChangeTriggerKey(int)}, {@link
DistributionZonesUtil#zoneScaleDownChangeTriggerKey(int)}
- * and {@link DistributionZonesUtil#zonesChangeTriggerKey(int)} if it
passes the condition.
+ * Creates or restores zone's state depending of the {@link
ZoneState#topologyAugmentationMap()} existence in the Vault.
+ * We save {@link ZoneState#topologyAugmentationMap()} in the Vault every
time we receive logical topology changes from the metastore.
+ *
+ * @param zone Zone's view.
+ * @param revision Revision for which we restore zone's state.
+ */
+ private void createOrRestoreZoneState(DistributionZoneView zone, long
revision) {
+ int zoneId = zone.zoneId();
+
+ VaultEntry topologyAugmentationMapFromVault =
vaultMgr.get(zoneTopologyAugmentationVault(zoneId)).join();
+
+ // First creation of a zone, or first call on the manager start for
the default zone.
+ if (topologyAugmentationMapFromVault == null) {
+ ZoneState zoneState = new ZoneState(executor);
+
+ zonesState.putIfAbsent(zoneId, zoneState);
Review Comment:
If it's first creation, why it's possible to have non absent zoneId. Should
we assert the putIfAbsent result?
--
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]