leekeiabstraction commented on code in PR #102:
URL: https://github.com/apache/fluss-rust/pull/102#discussion_r2645645741


##########
crates/fluss/src/cluster/cluster.rs:
##########
@@ -64,6 +64,43 @@ impl Cluster {
         }
     }
 
+    pub fn invalidate_server(&self, server_id: &i32, table_ids: Vec<i64>) -> 
Self {
+        let alive_tablet_servers_by_id = self
+            .alive_tablet_servers_by_id
+            .iter()
+            .filter(|&(id, _ts)| id != server_id)
+            .map(|(id, ts)| (*id, ts.clone()))
+            .collect();
+
+        let table_paths: HashSet<&TablePath> = table_ids
+            .iter()
+            .filter_map(|id| self.table_path_by_id.get(id))
+            .collect();
+
+        let available_locations_by_path = self
+            .available_locations_by_path
+            .iter()
+            .filter(|&(path, _locations)| !table_paths.contains(path))
+            .map(|(path, locations)| (path.clone(), locations.clone()))
+            .collect();
+
+        let available_locations_by_bucket = self
+            .available_locations_by_bucket
+            .iter()
+            .filter(|&(_bucket, location)| 
!table_paths.contains(&location.table_path))

Review Comment:
   This is consistent with java implementation, see
   
   
https://github.com/apache/fluss/blob/684a43de2388b28e0cc7a427471e3e17423b1c66/fluss-common/src/main/java/org/apache/fluss/cluster/Cluster.java#L124



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