alamb commented on code in PR #17031:
URL: https://github.com/apache/datafusion/pull/17031#discussion_r2255239869


##########
datafusion/execution/src/cache/lru_queue.rs:
##########
@@ -0,0 +1,490 @@
+use std::{
+    collections::HashMap,
+    hash::Hash,
+    sync::{Arc, Mutex, Weak},
+};
+
+#[derive(Default)]
+/// Provides a Least Recently Used queue with unbounded capacity.
+///
+/// # Examples
+///
+/// ```
+/// use datafusion_execution::cache::lru_queue::LruQueue;
+///
+/// let mut lru_queue: LruQueue<i32, i32> = LruQueue::new();
+/// lru_queue.put(1, 10);
+/// lru_queue.put(2, 20);
+/// lru_queue.put(3, 30);
+/// assert_eq!(lru_queue.get(&2), Some(&20));
+/// assert_eq!(lru_queue.pop(), Some((1, 10)));
+/// assert_eq!(lru_queue.pop(), Some((3, 30)));
+/// assert_eq!(lru_queue.pop(), Some((2, 20)));
+/// assert_eq!(lru_queue.pop(), None);
+/// ```
+pub struct LruQueue<K: Eq + Hash + Clone, V> {

Review Comment:
   I think we can start with this and simplify / improve the performance as 
follow on PRs if people hit issues with it



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