Skip to content

Commit 9feebb9

Browse files
authored
Deprecate DynamoCommit (#373) (#374)
1 parent c54728c commit 9feebb9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/aws/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ impl ObjectStore for AmazonS3 {
196196
r => r,
197197
}
198198
}
199+
#[allow(deprecated)]
199200
(PutMode::Create, S3ConditionalPut::Dynamo(d)) => {
200201
d.conditional_op(&self.client, location, None, move || request.do_put())
201202
.await
@@ -227,6 +228,7 @@ impl ObjectStore for AmazonS3 {
227228
r => r,
228229
}
229230
}
231+
#[allow(deprecated)]
230232
S3ConditionalPut::Dynamo(d) => {
231233
d.conditional_op(&self.client, location, Some(&etag), move || {
232234
request.do_put()
@@ -366,6 +368,7 @@ impl ObjectStore for AmazonS3 {
366368

367369
return res;
368370
}
371+
#[allow(deprecated)]
369372
Some(S3CopyIfNotExists::Dynamo(lock)) => {
370373
return lock.copy_if_not_exists(&self.client, from, to).await
371374
}
@@ -625,6 +628,7 @@ mod tests {
625628
put_get_delete_list(&integration).await;
626629

627630
match &integration.client.config.copy_if_not_exists {
631+
#[allow(deprecated)]
628632
Some(S3CopyIfNotExists::Dynamo(d)) => dynamo::integration_test(&integration, d).await,
629633
_ => eprintln!("Skipping dynamo integration test - dynamo not configured"),
630634
};

src/aws/precondition.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub enum S3CopyIfNotExists {
6969
/// See [`DynamoCommit`] for more information
7070
///
7171
/// This will use the same region, credentials and endpoint as configured for S3
72+
#[deprecated(note = "Use S3CopyIfNotExists::Multipart")]
7273
Dynamo(DynamoCommit),
7374
}
7475

@@ -80,6 +81,7 @@ impl std::fmt::Display for S3CopyIfNotExists {
8081
write!(f, "header-with-status: {k}: {v}: {}", code.as_u16())
8182
}
8283
Self::Multipart => f.write_str("multipart"),
84+
#[allow(deprecated)]
8385
Self::Dynamo(lock) => write!(f, "dynamo: {}", lock.table_name()),
8486
}
8587
}
@@ -108,6 +110,7 @@ impl S3CopyIfNotExists {
108110
code,
109111
))
110112
}
113+
#[allow(deprecated)]
111114
"dynamo" => Some(Self::Dynamo(DynamoCommit::from_str(value)?)),
112115
_ => None,
113116
}
@@ -147,6 +150,7 @@ pub enum S3ConditionalPut {
147150
/// See [`DynamoCommit`] for more information
148151
///
149152
/// This will use the same region, credentials and endpoint as configured for S3
153+
#[deprecated(note = "Use S3ConditionalPut::ETagMatch")]
150154
Dynamo(DynamoCommit),
151155

152156
/// Disable `conditional put`
@@ -157,6 +161,7 @@ impl std::fmt::Display for S3ConditionalPut {
157161
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
158162
match self {
159163
Self::ETagMatch => write!(f, "etag"),
164+
#[allow(deprecated)]
160165
Self::Dynamo(lock) => write!(f, "dynamo: {}", lock.table_name()),
161166
Self::Disabled => write!(f, "disabled"),
162167
}
@@ -169,6 +174,7 @@ impl S3ConditionalPut {
169174
"etag" => Some(Self::ETagMatch),
170175
"disabled" => Some(Self::Disabled),
171176
trimmed => match trimmed.split_once(':')? {
177+
#[allow(deprecated)]
172178
("dynamo", s) => Some(Self::Dynamo(DynamoCommit::from_str(s)?)),
173179
_ => None,
174180
},
@@ -214,6 +220,7 @@ mod tests {
214220
}
215221

216222
#[test]
223+
#[allow(deprecated)]
217224
fn parse_s3_copy_if_not_exists_dynamo() {
218225
let input = "dynamo: table:100";
219226
let expected = Some(S3CopyIfNotExists::Dynamo(
@@ -223,6 +230,7 @@ mod tests {
223230
}
224231

225232
#[test]
233+
#[allow(deprecated)]
226234
fn parse_s3_condition_put_dynamo() {
227235
let input = "dynamo: table:1300";
228236
let expected = Some(S3ConditionalPut::Dynamo(

0 commit comments

Comments
 (0)