viirya commented on code in PR #2336:
URL: https://github.com/apache/arrow-rs/pull/2336#discussion_r939555493


##########
object_store/src/lib.rs:
##########
@@ -231,6 +231,20 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + 
Debug + 'static {
     /// in the given byte range
     async fn get_range(&self, location: &Path, range: Range<usize>) -> 
Result<Bytes>;
 
+    /// Return the bytes that are stored at the specified location
+    /// in the given byte ranges
+    async fn get_ranges(
+        &self,
+        location: &Path,
+        ranges: &[Range<usize>],
+    ) -> Result<Vec<Bytes>> {
+        let mut out = Vec::with_capacity(ranges.len());
+        for range in ranges {
+            out.push(self.get_range(location, range.clone()).await?)
+        }
+        Ok(out)

Review Comment:
   Yea, `coalsce_ranges` looks should outperform current default 
implementation. Looks good to use it as default one.



-- 
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...@arrow.apache.org

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

Reply via email to