Ejemplo n.º 1
0
func (c *Collection) GetOrCreateVolumeLayout(rp *storage.ReplicaPlacement) *VolumeLayout {
	replicaPlacementIndex := rp.GetReplicationLevelIndex()
	if c.replicaType2VolumeLayout[replicaPlacementIndex] == nil {
		glog.V(0).Infoln("collection", c.Name, "adding replication type", rp)
		c.replicaType2VolumeLayout[replicaPlacementIndex] = NewVolumeLayout(rp, c.volumeSizeLimit)
	}
	return c.replicaType2VolumeLayout[replicaPlacementIndex]
}