Kontinuation commented on code in PR #592:
URL: https://github.com/apache/sedona-db/pull/592#discussion_r2788785975
##########
rust/sedona-spatial-join/src/probe/partitioned_stream_provider.rs:
##########
@@ -62,6 +64,41 @@ pub(crate) struct ProbeStreamOptions {
pub spilled_batch_in_memory_size_threshold: Option<usize>,
}
+impl ProbeStreamOptions {
+ pub fn new(
+ partitioner: Option<Box<dyn SpatialPartitioner>>,
+ target_batch_rows: usize,
+ spill_compression: SpillCompression,
+ buffer_bytes_threshold: usize,
+ spilled_batch_in_memory_size_threshold: Option<usize>,
+ ) -> Self {
+ let partitioner = partitioner.map(Mutex::new);
+ Self {
+ partitioner,
+ target_batch_rows,
+ spill_compression,
+ buffer_bytes_threshold,
+ spilled_batch_in_memory_size_threshold,
+ }
+ }
+}
+
+impl Clone for ProbeStreamOptions {
+ fn clone(&self) -> Self {
+ let cloned_partitioner = self
+ .partitioner
+ .as_ref()
+ .map(|p| Mutex::new(p.lock().box_clone()));
Review Comment:
We are using `parking_lot::Mutex` anyway, so this should not be a problem.
--
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]