You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/05/07 16:32:00 UTC

[GitHub] [ignite-3] vldpyatkov opened a new pull request #120: IGNITE-14237 Affinity function

vldpyatkov opened a new pull request #120:
URL: https://github.com/apache/ignite-3/pull/120


   


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



[GitHub] [ignite-3] sanpwc commented on a change in pull request #120: IGNITE-14237 Affinity function

Posted by GitBox <gi...@apache.org>.
sanpwc commented on a change in pull request #120:
URL: https://github.com/apache/ignite-3/pull/120#discussion_r631606348



##########
File path: modules/affinity/src/main/java/org/apache/ignite/internal/affinity/AffinityManager.java
##########
@@ -163,21 +113,43 @@ private void subscribeToAssignmentCalculation() {
     }
 
     /**
-     * Unsubscribes a listener form the affinity calculation.
+     * Calculates an assignment for a table which was specified by id.
+     *
+     * @param tblId Table identifier.
+     * @return A future which will complete when the assignment is calculated.
      */
-    private void unsubscribeFromAssignmentCalculation() {
-        if (affinityCalculateSubscriptionFut == null)
-            return;
-
-        try {
-            Long subscriptionId = affinityCalculateSubscriptionFut.get();
+    public CompletableFuture<Boolean> calculateAssignments(UUID tblId) {
+        return vaultManager.get(ByteArray.fromString(INTERNAL_PREFIX + tblId)).thenCompose(entry -> {
+            var tblConfig = configurationMgr.configurationRegistry().getConfiguration(TablesConfiguration.KEY).tables().get(new String(entry.value(), StandardCharsets.UTF_8));
+
+            var key = new Key(INTERNAL_PREFIX + tblId);
+
+            return metaStorageMgr.invoke(
+                Conditions.key(key).value().eq(null),

Review comment:
       Currently this will work, cause we don't support baseline changes, later we will need to generify
   `Conditions.key(key).value().eq(null),`
   to
   `Conditions.key(key).value().eq(oldAssignmentsValue),`
   where old assignments could be null, if it's table creation.




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



[GitHub] [ignite-3] sanpwc commented on a change in pull request #120: IGNITE-14237 Affinity function

Posted by GitBox <gi...@apache.org>.
sanpwc commented on a change in pull request #120:
URL: https://github.com/apache/ignite-3/pull/120#discussion_r631609035



##########
File path: modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -201,9 +176,22 @@ else if (evt.newEntry().value().length > 0) {
     }
 
     /**
-     * Subscribes on table create.
+     * Checks whether the local node hosts Metastorage.
      */
-    private void subscribeForTableCreation() {
+    private boolean isLocalNodeInvolvedMetastorage() {

Review comment:
       Let's reuse `org.apache.ignite.internal.metastorage.MetaStorageManager#hasMetastorageLocally`




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



[GitHub] [ignite-3] asfgit closed pull request #120: IGNITE-14237 Affinity function

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #120:
URL: https://github.com/apache/ignite-3/pull/120


   


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