You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/28 23:14:41 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3973: Add ObjectStore::list_with_offset (#3970)
tustvold commented on code in PR #3973:
URL: https://github.com/apache/arrow-rs/pull/3973#discussion_r1151239208
##########
object_store/src/lib.rs:
##########
@@ -371,11 +371,33 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
///
/// Prefixes are evaluated on a path segment basis, i.e. `foo/bar/` is a prefix of `foo/bar/x` but not of
/// `foo/bar_baz/x`.
+ ///
+ /// Note: the order of returned [`ObjectMeta`] is not guaranteed
async fn list(
&self,
prefix: Option<&Path>,
) -> Result<BoxStream<'_, Result<ObjectMeta>>>;
+ /// List all the objects with the given prefix and a location greater than `offset`
+ ///
+ /// Some stores, such as S3 and GCS, may be able to push `offset` down to reduce
+ /// the number of network requests required
+ ///
+ /// Note: the order of returned [`ObjectMeta`] is not guaranteed
+ async fn list_with_offset(
+ &self,
+ prefix: Option<&Path>,
+ offset: &Path,
+ ) -> Result<BoxStream<'_, Result<ObjectMeta>>> {
+ let offset = offset.clone();
Review Comment:
It is possible to construct the lifetimes to avoid this clone, but it seems unnecessary given we're likely performing a network call here, the overhead of a string clone is not going to be relevant
--
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