mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Filtering by volume id is prioritized.
This commit is contained in:
parent
563a74a9eb
commit
9668b15f38
|
@ -111,16 +111,16 @@ func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *Comman
|
||||||
|
|
||||||
func getVolumeFilter(replicaPlacement *super_block.ReplicaPlacement, volumeId uint32, collectionPattern string) func(message *master_pb.VolumeInformationMessage) bool {
|
func getVolumeFilter(replicaPlacement *super_block.ReplicaPlacement, volumeId uint32, collectionPattern string) func(message *master_pb.VolumeInformationMessage) bool {
|
||||||
replicaPlacementInt32 := uint32(replicaPlacement.Byte())
|
replicaPlacementInt32 := uint32(replicaPlacement.Byte())
|
||||||
if collectionPattern != "" {
|
if volumeId > 0 {
|
||||||
return func(v *master_pb.VolumeInformationMessage) bool {
|
return func(v *master_pb.VolumeInformationMessage) bool {
|
||||||
matched, err := filepath.Match(collectionPattern, v.Collection)
|
return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
|
||||||
if err != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return matched
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return func(v *master_pb.VolumeInformationMessage) bool {
|
return func(v *master_pb.VolumeInformationMessage) bool {
|
||||||
return v.Id == volumeId && v.ReplicaPlacement != replicaPlacementInt32
|
matched, err := filepath.Match(collectionPattern, v.Collection)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return matched
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue