aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/collection.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/topology/collection.go')
-rw-r--r--weed/topology/collection.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/weed/topology/collection.go b/weed/topology/collection.go
index e3aab2f76..d2bdeab62 100644
--- a/weed/topology/collection.go
+++ b/weed/topology/collection.go
@@ -44,6 +44,17 @@ func (c *Collection) GetOrCreateVolumeLayout(rp *super_block.ReplicaPlacement, t
return vl.(*VolumeLayout)
}
+func (c *Collection) DeleteVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, volumeType storage.VolumeType) {
+ keyString := rp.String()
+ if ttl != nil {
+ keyString += ttl.String()
+ }
+ if volumeType != storage.HardDriveType {
+ keyString += string(volumeType)
+ }
+ c.storageType2VolumeLayout.Delete(keyString)
+}
+
func (c *Collection) Lookup(vid needle.VolumeId) []*DataNode {
for _, vl := range c.storageType2VolumeLayout.Items() {
if vl != nil {