mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-25 20:06:53 +00:00
Adapt S3 API code to use new multipart upload models
- Create and PutPart - completemultipartupload - upload part copy - list_parts
This commit is contained in:
@@ -3,6 +3,7 @@ use std::sync::Arc;
|
||||
use garage_db as db;
|
||||
|
||||
use garage_util::data::*;
|
||||
use garage_util::error::*;
|
||||
|
||||
use garage_table::crdt::*;
|
||||
use garage_table::replication::TableShardedReplication;
|
||||
@@ -188,6 +189,16 @@ impl Version {
|
||||
.binary_search_by(|(k, _)| k.part_number.cmp(&part_number))
|
||||
.is_ok()
|
||||
}
|
||||
|
||||
pub fn n_parts(&self) -> Result<u64, Error> {
|
||||
Ok(self
|
||||
.blocks
|
||||
.items()
|
||||
.last()
|
||||
.ok_or_message("version has no parts")?
|
||||
.0
|
||||
.part_number)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for VersionBlockKey {
|
||||
|
||||
Reference in New Issue
Block a user