mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 11:06:17 +00:00
refactor(replication): add runtime boundary (#4067)
This commit is contained in:
@@ -18,6 +18,7 @@ mod replication_pool;
|
||||
mod replication_resyncer;
|
||||
mod replication_state;
|
||||
mod rule;
|
||||
mod runtime_boundary;
|
||||
|
||||
pub use config::*;
|
||||
pub use datatypes::*;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use super::runtime_boundary as runtime_sources;
|
||||
use crate::bucket::bucket_target_sys::BucketTargetSys;
|
||||
use crate::bucket::metadata_sys;
|
||||
use crate::bucket::replication::ResyncOpts;
|
||||
@@ -28,7 +29,6 @@ use crate::config::com::{read_config, save_config};
|
||||
use crate::disk::BUCKET_META_PREFIX;
|
||||
use crate::error::Error as EcstoreError;
|
||||
use crate::object_api::{ObjectInfo, ObjectOptions};
|
||||
use crate::runtime::sources as runtime_sources;
|
||||
use crate::storage_api_contracts::object::DeletedObject;
|
||||
use crate::storage_api_contracts::object::EcstoreObjectIO;
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use super::runtime_boundary as runtime_sources;
|
||||
use crate::bucket::bandwidth::reader::{BucketOptions, MonitorReaderOptions, MonitoredReader};
|
||||
use crate::bucket::bucket_target_sys::{
|
||||
AdvancedPutOptions, BucketTargetSys, PutObjectOptions, PutObjectPartOptions, RemoveObjectOptions, TargetClient,
|
||||
@@ -28,7 +29,6 @@ use crate::config::com::save_config;
|
||||
use crate::disk::{BUCKET_META_PREFIX, RUSTFS_META_BUCKET};
|
||||
use crate::error::{Error, Result, is_err_object_not_found, is_err_version_not_found};
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::runtime::sources as runtime_sources;
|
||||
use crate::services::event_notification::{EventArgs, send_event};
|
||||
use crate::set_disk::get_lock_acquire_timeout;
|
||||
use crate::storage_api_contracts::{
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use super::runtime_boundary as runtime_sources;
|
||||
use crate::error::Error;
|
||||
use crate::runtime::sources as runtime_sources;
|
||||
use rustfs_filemeta::{ReplicatedTargetInfo, ReplicationStatusType, ReplicationType};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright 2024 RustFS Team
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::bucket::bandwidth::monitor::Monitor;
|
||||
use crate::bucket::replication::replication_pool::DynReplicationPool;
|
||||
use crate::bucket::replication::replication_state::ReplicationStats;
|
||||
use crate::runtime::sources;
|
||||
use crate::store::ECStore;
|
||||
|
||||
pub(crate) fn object_store_handle() -> Option<Arc<ECStore>> {
|
||||
sources::object_store_handle()
|
||||
}
|
||||
|
||||
pub(crate) fn default_local_node_name() -> String {
|
||||
sources::default_local_node_name()
|
||||
}
|
||||
|
||||
pub(crate) fn replication_pool() -> Option<Arc<DynReplicationPool>> {
|
||||
sources::replication_pool()
|
||||
}
|
||||
|
||||
pub(crate) fn replication_stats() -> Option<Arc<ReplicationStats>> {
|
||||
sources::replication_stats()
|
||||
}
|
||||
|
||||
pub(crate) fn replication_runtime_initialized() -> bool {
|
||||
sources::replication_runtime_initialized()
|
||||
}
|
||||
|
||||
pub(crate) fn bucket_monitor() -> Option<Arc<Monitor>> {
|
||||
sources::bucket_monitor()
|
||||
}
|
||||
Reference in New Issue
Block a user