mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 23:17:23 +08:00
filer conf: delete location specific configuration
This commit is contained in:
@@ -82,6 +82,18 @@ func (fc *FilerConf) AddLocationConf(locConf *filer_pb.FilerConf_PathConf) (err
|
||||
return
|
||||
}
|
||||
|
||||
func (fc *FilerConf) DeleteLocationConf(locationPrefix string) {
|
||||
rules := ptrie.New()
|
||||
fc.rules.Walk(func(key []byte, value interface{}) bool {
|
||||
if string(key) == locationPrefix {
|
||||
return true
|
||||
}
|
||||
rules.Put(key, value)
|
||||
return true
|
||||
})
|
||||
fc.rules = rules
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
EmptyFilerConfPathConf = &filer_pb.FilerConf_PathConf{}
|
||||
@@ -110,4 +122,4 @@ func (fc *FilerConf) ToProto() *filer_pb.FilerConf {
|
||||
|
||||
func (fc *FilerConf) ToText(writer io.Writer) error {
|
||||
return proto.MarshalText(writer, fc.ToProto())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user