add http endpoint to get the size of a collection (#5910)
This commit is contained in:
committed by
GitHub
parent
e50d85c0f3
commit
6fe8639504
@@ -44,6 +44,28 @@ func (c *Collection) GetOrCreateVolumeLayout(rp *super_block.ReplicaPlacement, t
|
||||
return vl.(*VolumeLayout)
|
||||
}
|
||||
|
||||
func (c *Collection) GetVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType) (*VolumeLayout, bool) {
|
||||
keyString := rp.String()
|
||||
if ttl != nil {
|
||||
keyString += ttl.String()
|
||||
}
|
||||
if diskType != types.HardDriveType {
|
||||
keyString += string(diskType)
|
||||
}
|
||||
vl, ok := c.storageType2VolumeLayout.Find(keyString)
|
||||
return vl.(*VolumeLayout), ok
|
||||
}
|
||||
|
||||
func (c *Collection) GetAllVolumeLayouts() []*VolumeLayout {
|
||||
var vls []*VolumeLayout
|
||||
for _, vl := range c.storageType2VolumeLayout.Items() {
|
||||
if vl != nil {
|
||||
vls = append(vls, vl.(*VolumeLayout))
|
||||
}
|
||||
}
|
||||
return vls
|
||||
}
|
||||
|
||||
func (c *Collection) DeleteVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType) {
|
||||
keyString := rp.String()
|
||||
if ttl != nil {
|
||||
|
||||
Reference in New Issue
Block a user