move chunk_store to pbs-datastore
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -8,6 +8,8 @@ use proxmox::api::{api, Router, RpcEnvironment, Permission};
|
||||
use proxmox::api::section_config::SectionConfigData;
|
||||
use proxmox::api::schema::parse_property_string;
|
||||
|
||||
use pbs_datastore::task::TaskState;
|
||||
|
||||
use crate::api2::types::*;
|
||||
use crate::backup::*;
|
||||
use crate::config::cached_user_info::CachedUserInfo;
|
||||
@ -54,7 +56,7 @@ pub(crate) fn do_create_datastore(
|
||||
_lock: std::fs::File,
|
||||
mut config: SectionConfigData,
|
||||
datastore: DataStoreConfig,
|
||||
worker: Option<&dyn crate::task::TaskState>,
|
||||
worker: Option<&dyn TaskState>,
|
||||
) -> Result<(), Error> {
|
||||
let path: PathBuf = datastore.path.clone().into();
|
||||
|
||||
|
@ -15,9 +15,10 @@ use proxmox::{
|
||||
},
|
||||
};
|
||||
|
||||
use pbs_datastore::{task_log, task_warn};
|
||||
use pbs_datastore::task::TaskState;
|
||||
|
||||
use crate::{
|
||||
task_log,
|
||||
task_warn,
|
||||
config::{
|
||||
self,
|
||||
cached_user_info::CachedUserInfo,
|
||||
@ -55,7 +56,6 @@ use crate::{
|
||||
Userid,
|
||||
},
|
||||
server::WorkerTask,
|
||||
task::TaskState,
|
||||
tape::{
|
||||
TAPE_STATUS_DIR,
|
||||
Inventory,
|
||||
|
@ -22,8 +22,9 @@ use proxmox::{
|
||||
},
|
||||
};
|
||||
|
||||
use pbs_datastore::task_log;
|
||||
|
||||
use crate::{
|
||||
task_log,
|
||||
config::{
|
||||
self,
|
||||
cached_user_info::CachedUserInfo,
|
||||
|
@ -28,10 +28,10 @@ use proxmox::{
|
||||
},
|
||||
};
|
||||
|
||||
use pbs_datastore::{task_log, task_warn};
|
||||
use pbs_datastore::task::TaskState;
|
||||
|
||||
use crate::{
|
||||
task_log,
|
||||
task_warn,
|
||||
task::TaskState,
|
||||
tools::ParallelHandler,
|
||||
api2::types::{
|
||||
DATASTORE_MAP_ARRAY_SCHEMA,
|
||||
|
@ -683,59 +683,6 @@ pub struct BackupContent {
|
||||
pub size: Option<u64>,
|
||||
}
|
||||
|
||||
#[api(
|
||||
properties: {
|
||||
"upid": {
|
||||
optional: true,
|
||||
schema: UPID_SCHEMA,
|
||||
},
|
||||
},
|
||||
)]
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all="kebab-case")]
|
||||
/// Garbage collection status.
|
||||
pub struct GarbageCollectionStatus {
|
||||
pub upid: Option<String>,
|
||||
/// Number of processed index files.
|
||||
pub index_file_count: usize,
|
||||
/// Sum of bytes referred by index files.
|
||||
pub index_data_bytes: u64,
|
||||
/// Bytes used on disk.
|
||||
pub disk_bytes: u64,
|
||||
/// Chunks used on disk.
|
||||
pub disk_chunks: usize,
|
||||
/// Sum of removed bytes.
|
||||
pub removed_bytes: u64,
|
||||
/// Number of removed chunks.
|
||||
pub removed_chunks: usize,
|
||||
/// Sum of pending bytes (pending removal - kept for safety).
|
||||
pub pending_bytes: u64,
|
||||
/// Number of pending chunks (pending removal - kept for safety).
|
||||
pub pending_chunks: usize,
|
||||
/// Number of chunks marked as .bad by verify that have been removed by GC.
|
||||
pub removed_bad: usize,
|
||||
/// Number of chunks still marked as .bad after garbage collection.
|
||||
pub still_bad: usize,
|
||||
}
|
||||
|
||||
impl Default for GarbageCollectionStatus {
|
||||
fn default() -> Self {
|
||||
GarbageCollectionStatus {
|
||||
upid: None,
|
||||
index_file_count: 0,
|
||||
index_data_bytes: 0,
|
||||
disk_bytes: 0,
|
||||
disk_chunks: 0,
|
||||
removed_bytes: 0,
|
||||
removed_chunks: 0,
|
||||
pending_bytes: 0,
|
||||
pending_chunks: 0,
|
||||
removed_bad: 0,
|
||||
still_bad: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[api()]
|
||||
#[derive(Default, Serialize, Deserialize)]
|
||||
/// Storage space usage information.
|
||||
|
Reference in New Issue
Block a user