ibessonov commented on code in PR #1016:
URL: https://github.com/apache/ignite-3/pull/1016#discussion_r958104032


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -365,6 +380,50 @@ public CompletableFuture<Boolean> notify(@NotNull 
SchemaEventParameters paramete
                 return completedFuture(false);
             }
         });
+
+        addMessageHandler(raftMgr.messagingService());
+    }
+
+    /**
+     * Adds a table manager message handler.
+     *
+     * @param messagingService Messaging service.
+     */
+    private void addMessageHandler(MessagingService messagingService) {
+        var messageHandler = new NetworkMessageHandler() {
+            @Override
+            public void onReceived(NetworkMessage message, NetworkAddress 
senderAddr, @Nullable Long correlationId) {
+                if (message instanceof HasDataRequest) {
+                    // This message queries if a node has any data for a 
specific partition of a table
+                    assert correlationId != null;
+
+                    HasDataRequest msg = (HasDataRequest) message;
+
+                    UUID tableId = msg.tableId();
+                    int partitionId = msg.partitionId();
+
+                    boolean contains = false;
+
+                    TableImpl table = tablesByIdVv.latest().get(tableId);

Review Comment:
   Is this a operation fast enough to not stall the network thread?



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