diff options
Diffstat (limited to 'weed/topology/volume_layout.go')
| -rw-r--r-- | weed/topology/volume_layout.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index 79ed70c0f..44a25565e 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -107,6 +107,13 @@ func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool { !v.ReadOnly } +func (vl *VolumeLayout) isEmpty() bool { + vl.accessLock.RLock() + defer vl.accessLock.RUnlock() + + return len(vl.vid2location) == 0 +} + func (vl *VolumeLayout) Lookup(vid storage.VolumeId) []*DataNode { vl.accessLock.RLock() defer vl.accessLock.RUnlock() |
