mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 02:38:12 +00:00
refactor(storage): narrow metadata bounds (#3343)
This commit is contained in:
@@ -566,11 +566,11 @@ impl RebalanceMeta {
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
pub async fn load<S: StorageAPI>(&mut self, store: Arc<S>) -> Result<()> {
|
||||
pub async fn load<S: ObjectIO>(&mut self, store: Arc<S>) -> Result<()> {
|
||||
self.load_with_opts(store, ObjectOptions::default()).await
|
||||
}
|
||||
|
||||
pub async fn load_with_opts<S: StorageAPI>(&mut self, store: Arc<S>, opts: ObjectOptions) -> Result<()> {
|
||||
pub async fn load_with_opts<S: ObjectIO>(&mut self, store: Arc<S>, opts: ObjectOptions) -> Result<()> {
|
||||
let (data, _) = read_config_with_metadata(store, REBAL_META_NAME, &opts).await?;
|
||||
if data.is_empty() {
|
||||
info!("rebalanceMeta load_with_opts: no data");
|
||||
@@ -599,11 +599,11 @@ impl RebalanceMeta {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn save<S: StorageAPI>(&self, store: Arc<S>) -> Result<()> {
|
||||
pub async fn save<S: ObjectIO>(&self, store: Arc<S>) -> Result<()> {
|
||||
self.save_with_opts(store, ObjectOptions::default()).await
|
||||
}
|
||||
|
||||
pub async fn save_with_opts<S: StorageAPI>(&self, store: Arc<S>, opts: ObjectOptions) -> Result<()> {
|
||||
pub async fn save_with_opts<S: ObjectIO>(&self, store: Arc<S>, opts: ObjectOptions) -> Result<()> {
|
||||
if self.pool_stats.is_empty() {
|
||||
info!("rebalanceMeta save_with_opts: no pool stats");
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user