tustvold commented on code in PR #4984:
URL: https://github.com/apache/arrow-rs/pull/4984#discussion_r1370178234
##########
object_store/src/lib.rs:
##########
@@ -827,13 +841,65 @@ impl GetResult {
}
}
+/// Configure preconditions for the put operation
+#[derive(Debug, Clone, PartialEq, Eq, Default)]
+pub enum PutMode {
+ /// Perform an atomic write operation, overwriting any object present at
the provided path
+ #[default]
+ Overwrite,
+ /// Perform an atomic write operation, returning [`Error::AlreadyExists`]
if an
+ /// object already exists at the provided path
+ Create,
+ /// Perform an atomic write operation if the current version of the object
matches the
+ /// provided [`UpdateVersion`], returning [`Error::Precondition`] otherwise
+ Update(UpdateVersion),
+}
+
+/// Uniquely identifies a version of an object to update
+///
+/// Stores will use differing combinations of `e_tag` and `version` to provide
conditional
+/// updates, and it is therefore recommended applications preserve both
Review Comment:
This is kind of annoying, but is necessary because GCS doesn't support
etag-based preconditions on put, only ifGenerationMatch
--
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]