forked from vitalif/vitastor
Rename random_combinations() parameter from "unordered" to "ordered" as it's more correct
parent
fcb4aa0a11
commit
e16b87ecc8
|
@ -493,8 +493,8 @@ function extract_osds(osd_tree, levels, osd_level, osds = {})
|
||||||
return osds;
|
return osds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// unordered = don't treat (x,y) and (y,x) as equal
|
// ordered = don't treat (x,y) and (y,x) as equal
|
||||||
function random_combinations(osd_tree, pg_size, count, unordered)
|
function random_combinations(osd_tree, pg_size, count, ordered)
|
||||||
{
|
{
|
||||||
let seed = 0x5f020e43;
|
let seed = 0x5f020e43;
|
||||||
let rng = () =>
|
let rng = () =>
|
||||||
|
@ -523,7 +523,7 @@ function random_combinations(osd_tree, pg_size, count, unordered)
|
||||||
cur_hosts.splice(next_host, 1);
|
cur_hosts.splice(next_host, 1);
|
||||||
}
|
}
|
||||||
const cyclic_pgs = [ pg ];
|
const cyclic_pgs = [ pg ];
|
||||||
if (unordered)
|
if (ordered)
|
||||||
{
|
{
|
||||||
for (let i = 1; i < pg.size; i++)
|
for (let i = 1; i < pg.size; i++)
|
||||||
{
|
{
|
||||||
|
@ -546,7 +546,7 @@ function random_combinations(osd_tree, pg_size, count, unordered)
|
||||||
let host_idx = [];
|
let host_idx = [];
|
||||||
const cur_hosts = [ ...hosts.map((h, i) => i) ];
|
const cur_hosts = [ ...hosts.map((h, i) => i) ];
|
||||||
const max_hosts = pg_size < hosts.length ? pg_size : hosts.length;
|
const max_hosts = pg_size < hosts.length ? pg_size : hosts.length;
|
||||||
if (unordered)
|
if (ordered)
|
||||||
{
|
{
|
||||||
for (let i = 0; i < max_hosts; i++)
|
for (let i = 0; i < max_hosts; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue