zuston commented on code in PR #1311:
URL: 
https://github.com/apache/incubator-uniffle/pull/1311#discussion_r1395567493


##########
rust/experimental/server/src/grpc.rs:
##########
@@ -349,6 +366,7 @@ impl ShuffleServer for DefaultShuffleServer {
                     req.last_block_id,
                     req.read_buffer_size as i64,
                 ),
+                serialized_expected_task_ids_bitmap: 
serialized_expected_task_ids_bitmap.clone(),

Review Comment:
   No need to use `clone,` right?



##########
rust/experimental/server/src/store/memory.rs:
##########
@@ -413,6 +418,14 @@ impl Store for MemoryStore {
                                 last_block_id = -1;
                             }
                         }
+                        candidate_blocks = candidate_blocks
+                            .into_iter()
+                            .filter(|block| {
+                                block_ids_filter
+                                    .as_ref()
+                                    .map_or(true, |filter| 
filter.contains(block.block_id as u64))
+                            })
+                            .collect();
                     }
                 }
 

Review Comment:
   How about putting this filter here? 
   
   ```
    candidate_blocks = candidate_blocks
                               .into_iter()
                               .filter(|block| {
                                   block_ids_filter
                                       .as_ref()
                                       .map_or(true, |filter| 
filter.contains(block.block_id as u64))
                               })
                               .collect();
   ```



##########
rust/experimental/server/src/store/memory.rs:
##########
@@ -413,6 +418,14 @@ impl Store for MemoryStore {
                                 last_block_id = -1;
                             }
                         }
+                        candidate_blocks = candidate_blocks
+                            .into_iter()
+                            .filter(|block| {
+                                block_ids_filter
+                                    .as_ref()
+                                    .map_or(true, |filter| 
filter.contains(block.block_id as u64))
+                            })
+                            .collect();
                     }
                 }
 

Review Comment:
   Otherwise, when the last_block_id = -1, the filter is not valid. This case 
also should be added into test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to