vldpyatkov commented on a change in pull request #103:
URL: https://github.com/apache/ignite-3/pull/103#discussion_r620076046
##########
File path:
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/AffinityManager.java
##########
@@ -52,9 +72,121 @@ public AffinityManager(
this.configurationMgr = configurationMgr;
this.metaStorageMgr = metaStorageMgr;
this.baselineMgr = baselineMgr;
+
+ String localNodeName =
configurationMgr.configurationRegistry().getConfiguration(NetworkConfiguration.KEY)
+ .name().value();
+
+
configurationMgr.configurationRegistry().getConfiguration(LocalConfiguration.KEY)
+ .metastorageMembers().listen(ctx -> {
+ if (ctx.newValue() != null) {
+ if (hasMetastorageLocally(localNodeName, ctx.newValue()))
+ subscribeToAssignmentCalculation();
+ else
+ unsubscribeFromAssignmentCalculation();
+ }
+ return CompletableFuture.completedFuture(null);
+ });
+
+ String[] metastorageMembers =
configurationMgr.configurationRegistry().getConfiguration(LocalConfiguration.KEY)
+ .metastorageMembers().value();
+
+ if (hasMetastorageLocally(localNodeName, metastorageMembers))
+ subscribeToAssignmentCalculation();
}
- // TODO: IGNITE-14237 Affinity function.
- // TODO: IGNITE-14238 Creating and destroying caches.
- // TODO: IGNITE-14235 Provide a minimal cache/table configuration.
+ /**
+ * Tests a node has a involved into Metastorage.
Review comment:
Done.
--
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]