mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 20:06:37 +00:00
init:store
This commit is contained in:
+32
-2
@@ -311,7 +311,7 @@ impl PoolEndpointList {
|
||||
|
||||
// PoolEndpoints represent endpoints in a given pool
|
||||
// along with its setCount and setDriveCount.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PoolEndpoints {
|
||||
// indicates if endpoints are provided in non-ellipses style
|
||||
pub legacy: bool,
|
||||
@@ -331,6 +331,36 @@ impl EndpointServerPools {
|
||||
Self(Vec::new())
|
||||
}
|
||||
|
||||
// create_server_endpoints
|
||||
pub fn create_server_endpoints(
|
||||
server_addr: String,
|
||||
pool_args: &Vec<PoolDisksLayout>,
|
||||
legacy: bool,
|
||||
) -> Result<(EndpointServerPools, SetupType), Error> {
|
||||
if pool_args.is_empty() {
|
||||
return Err(Error::msg("无效参数"));
|
||||
}
|
||||
|
||||
let (pooleps, setup_type) = create_pool_endpoints(server_addr, pool_args)?;
|
||||
|
||||
let mut ret = EndpointServerPools::new();
|
||||
|
||||
for (i, eps) in pooleps.iter().enumerate() {
|
||||
let ep = PoolEndpoints {
|
||||
legacy: legacy,
|
||||
set_count: pool_args[i].layout.len(),
|
||||
drives_per_set: pool_args[i].layout[0].len(),
|
||||
endpoints: eps.clone(),
|
||||
cmd_line: pool_args[i].cmdline.clone(),
|
||||
platform: String::new(),
|
||||
};
|
||||
|
||||
ret.add(ep)?;
|
||||
}
|
||||
|
||||
Ok((ret, setup_type))
|
||||
}
|
||||
|
||||
pub fn first_is_local(&self) -> bool {
|
||||
if self.0.is_empty() {
|
||||
return false;
|
||||
@@ -537,7 +567,7 @@ pub fn create_pool_endpoints(
|
||||
}
|
||||
|
||||
// create_server_endpoints
|
||||
pub fn create_server_endpoints(
|
||||
fn create_server_endpoints(
|
||||
server_addr: String,
|
||||
pool_args: &Vec<PoolDisksLayout>,
|
||||
legacy: bool,
|
||||
|
||||
Reference in New Issue
Block a user