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/07/30 13:46:19 UTC

[GitHub] [arrow-rs] tustvold opened a new issue, #2241: Get Request Precondition Support

tustvold opened a new issue, #2241:
URL: https://github.com/apache/arrow-rs/issues/2241

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for this feature, in addition to  the *what*)
   -->
   
   There are 4 broadly supported request preconditions:
   
   * If-Match
   * If-Not-Match
   * If-Not-Modified-Since
   * If-Unmodified-Since
   
   https://cloud.google.com/storage/docs/request-preconditions
   https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations
   https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html#API_GetObject_RequestSyntax
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   I would like to propose adding
   
   
   ```
   #[derive(Debug, Default)]
   struct GetOptions {
       pub if_match: Option<String>,
       pub if_not_match: Option<String>,
       pub if_not_modified_since: Option<DateTime<Utc>>,
       pub if_unmodified_since: Option<DateTime<Utc>>,
   }
   
   pub trait ObjectStore {
        async fn get_opts(&self, location: &Path, options: GetOptions) -> Result<GetResult>
   
        async fn get_range_opts(&self, location: &Path, range: Option<usize>, options: GetOptions) -> Result<Bytes>
        ...
   }
   
   pub enum Error {
       #[snafu(display("Precondition failed: {}", source))]
       Precondition {
           source: Box<dyn std::error::Error + Send + Sync + 'static>,
       }
   
       #[snafu(display("Not modified: {}", source))]
       NotModified {
           source: Box<dyn std::error::Error + Send + Sync + 'static>,
       }
   }
   ```
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features you've considered.
   -->
   
   We could not add support for this
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   
   #2230 
   


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

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


[GitHub] [arrow-rs] crepererum commented on issue #2241: Get Request Precondition Support

Posted by GitBox <gi...@apache.org>.
crepererum commented on issue #2241:
URL: https://github.com/apache/arrow-rs/issues/2241#issuecomment-1200903725

   How do you model stores that don't support these checks? Do they just return "unsupported" errors?


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


[GitHub] [arrow-rs] tustvold commented on issue #2241: Get Request Precondition Support

Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #2241:
URL: https://github.com/apache/arrow-rs/issues/2241#issuecomment-1201065016

   Yeah, I would expect such stores to return `Error::NotSupported` if the feature cannot be supported, and `Error::NotImplemented` if it simply has not been implemented


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


[GitHub] [arrow-rs] crepererum commented on issue #2241: Get Request Precondition Support

Posted by GitBox <gi...@apache.org>.
crepererum commented on issue #2241:
URL: https://github.com/apache/arrow-rs/issues/2241#issuecomment-1200913479

   > All stores support these for get requests.
   
   I think this crate also provides some extendable interface, i.e. users can implement their own  stores and use for example `etcd` as a storage backend. But I suppose every store could implement this check client-side if the "other end" doesn't support it, so this is OK then.


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


[GitHub] [arrow-rs] tustvold closed issue #2241: Get Request Precondition Support

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #2241: Get Request Precondition Support
URL: https://github.com/apache/arrow-rs/issues/2241


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


[GitHub] [arrow-rs] tustvold commented on issue #2241: Get Request Precondition Support

Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #2241:
URL: https://github.com/apache/arrow-rs/issues/2241#issuecomment-1200909703

   All stores support these for get requests.


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