EmilyMatt commented on code in PR #15613:
URL: https://github.com/apache/datafusion/pull/15613#discussion_r2035962547


##########
datafusion/execution/src/memory_pool/pool.rs:
##########
@@ -277,40 +284,29 @@ impl<I: MemoryPool> TrackConsumersPool<I> {
         }
     }
 
-    /// Determine if there are multiple [`MemoryConsumer`]s registered
-    /// which have the same name.
-    ///
-    /// This is very tied to the implementation of the memory consumer.
-    fn has_multiple_consumers(&self, name: &String) -> bool {
-        let consumer = MemoryConsumer::new(name);
-        let consumer_with_spill = consumer.clone().with_can_spill(true);
-        let guard = self.tracked_consumers.lock();
-        guard.contains_key(&consumer) && 
guard.contains_key(&consumer_with_spill)
-    }
-
     /// The top consumers in a report string.
     pub fn report_top(&self, top: usize) -> String {
         let mut consumers = self
             .tracked_consumers
             .lock()
             .iter()
-            .map(|(consumer, reserved)| {
+            .map(|(consumer_id, tracked_consumer)| {
                 (
-                    (consumer.name().to_owned(), consumer.can_spill()),
-                    reserved.load(Ordering::Acquire),
+                    (
+                        *consumer_id,
+                        tracked_consumer.name.to_owned(),
+                        tracked_consumer.can_spill,
+                    ),
+                    tracked_consumer.reserved.load(Ordering::Acquire),

Review Comment:
   Sounds good to me, 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.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to