|
|
@ -166,6 +166,7 @@ func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter { |
|
|
|
} |
|
|
|
|
|
|
|
func (t *Topology) SyncDataNodeRegistration(volumes []*master_pb.VolumeInformationMessage, dn *DataNode) (newVolumes, deletedVolumes []storage.VolumeInfo) { |
|
|
|
// convert into in memory struct storage.VolumeInfo
|
|
|
|
var volumeInfos []storage.VolumeInfo |
|
|
|
for _, v := range volumes { |
|
|
|
if vi, err := storage.NewVolumeInfo(v); err == nil { |
|
|
@ -174,6 +175,7 @@ func (t *Topology) SyncDataNodeRegistration(volumes []*master_pb.VolumeInformati |
|
|
|
glog.V(0).Infof("Fail to convert joined volume information: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
// find out the delta volumes
|
|
|
|
newVolumes, deletedVolumes = dn.UpdateVolumes(volumeInfos) |
|
|
|
for _, v := range newVolumes { |
|
|
|
t.RegisterVolumeLayout(v, dn) |
|
|
|