mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 23:47:28 +00:00
refactor: move object list helper contracts (#3546)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use rustfs_storage_api::{HTTPPreconditions, ObjectLockRetentionOptions};
|
||||
use rustfs_storage_api::{HTTPPreconditions, ObjectLockRetentionOptions, VersionMarker, WalkVersionsSortOrder};
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct ObjectOptions {
|
||||
@@ -740,12 +740,6 @@ impl ObjectInfo {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum VersionMarker {
|
||||
Null,
|
||||
Version(Uuid),
|
||||
}
|
||||
|
||||
fn versions_after_marker(file_infos: &rustfs_filemeta::FileInfoVersions, marker: VersionMarker) -> &[FileInfo] {
|
||||
let marker_idx = match marker {
|
||||
VersionMarker::Null => file_infos.versions.iter().position(|version| version.version_id.is_none()),
|
||||
@@ -876,13 +870,6 @@ pub struct WalkOptions {
|
||||
pub include_free_versions: bool, // include persisted tier free-version cleanup records
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, PartialEq, Eq)]
|
||||
pub enum WalkVersionsSortOrder {
|
||||
#[default]
|
||||
Ascending,
|
||||
Descending,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ObjectInfoOrErr {
|
||||
pub item: Option<ObjectInfo>,
|
||||
|
||||
@@ -23,8 +23,7 @@ use crate::error::{
|
||||
};
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::store_api::{
|
||||
ListObjectVersionsInfo, ListObjectsInfo, ObjectInfo, ObjectInfoOrErr, ObjectOperations, ObjectOptions, VersionMarker,
|
||||
WalkOptions, WalkVersionsSortOrder,
|
||||
ListObjectVersionsInfo, ListObjectsInfo, ObjectInfo, ObjectInfoOrErr, ObjectOperations, ObjectOptions, WalkOptions,
|
||||
};
|
||||
use crate::store_utils::is_reserved_or_invalid_bucket;
|
||||
use crate::{store::ECStore, store_api::ListObjectsV2Info};
|
||||
@@ -34,6 +33,7 @@ use rustfs_filemeta::{
|
||||
MetaCacheEntries, MetaCacheEntriesSorted, MetaCacheEntriesSortedResult, MetaCacheEntry, MetadataResolutionParams,
|
||||
merge_file_meta_versions,
|
||||
};
|
||||
use rustfs_storage_api::{VersionMarker, WalkVersionsSortOrder};
|
||||
use rustfs_utils::path::{self, SLASH_SEPARATOR, base_dir_from_prefix};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
@@ -201,11 +201,7 @@ fn list_metadata_resolution_params(bucket: String, listing_quorum: usize, versio
|
||||
}
|
||||
|
||||
fn parse_version_marker(marker: String) -> Result<VersionMarker> {
|
||||
if marker == "null" {
|
||||
Ok(VersionMarker::Null)
|
||||
} else {
|
||||
Ok(VersionMarker::Version(Uuid::parse_str(&marker)?))
|
||||
}
|
||||
Ok(VersionMarker::parse(marker)?)
|
||||
}
|
||||
|
||||
fn version_marker_for_entries(
|
||||
|
||||
Reference in New Issue
Block a user