diff --git a/weed-fs/src/pkg/replication/volume_growth.go b/weed-fs/src/pkg/replication/volume_growth.go new file mode 100644 index 000000000..49afc741c --- /dev/null +++ b/weed-fs/src/pkg/replication/volume_growth.go @@ -0,0 +1,29 @@ +package replication + +import ( + "pkg/topology" +) + +/* +This package is created to resolve these replica placement issues: +1. growth factor for each replica level, e.g., add 10 volumes for 1 copy, 20 volumes for 2 copies, 30 volumes for 3 copies +2. in time of tight storage, how to reduce replica level +3. optimizing for hot data on faster disk, cold data on cheaper storage, +4. volume allocation for each bucket +*/ + +type VolumeGrowth struct { + copy1factor int + copy2factor int + copy3factor int + copyAll int +} + +func (vg *VolumeGrowth) GrowVolumeCopy(copyLevel int, topo topology.Topology) { + if copyLevel == 1 { + for i := 0; i