filer server: add "datacenter, rack and datanode" for path specific configuration

This commit is contained in:
banjiaojuhao
2021-12-23 23:24:10 +08:00
parent b541e39a2c
commit 083bf3a137
6 changed files with 182 additions and 142 deletions

View File

@@ -159,16 +159,15 @@ func mergePathConf(a, b *filer_pb.FilerConf_PathConf) {
a.Collection = util.Nvl(b.Collection, a.Collection)
a.Replication = util.Nvl(b.Replication, a.Replication)
a.Ttl = util.Nvl(b.Ttl, a.Ttl)
if b.DiskType != "" {
a.DiskType = b.DiskType
}
a.DiskType = util.Nvl(b.DiskType, a.DiskType)
a.Fsync = b.Fsync || a.Fsync
if b.VolumeGrowthCount > 0 {
a.VolumeGrowthCount = b.VolumeGrowthCount
}
if b.ReadOnly {
a.ReadOnly = b.ReadOnly
}
a.ReadOnly = b.ReadOnly || a.ReadOnly
a.DataCenter = util.Nvl(b.DataCenter, a.DataCenter)
a.Rack = util.Nvl(b.Rack, a.Rack)
a.DataNode = util.Nvl(b.DataNode, a.DataNode)
}
func (fc *FilerConf) ToProto() *filer_pb.FilerConf {