You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/06 18:25:56 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2336: Add ObjectStore::get_ranges (#2293)

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


##########
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:
   I guess I was concerned that some implementations may not benefit from this, but then again perhaps those cases should override this 🤔



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

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