You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
677 B

package topology
import "github.com/chrislusf/seaweedfs/go/glog"
func (t *Topology) Replicate() int {
glog.V(0).Infoln("Start replicate checker on demand")
for _, col := range t.collectionMap.Items {
c := col.(*Collection)
glog.V(0).Infoln("checking replicate on collection:", c.Name)
for _, vl := range c.storageType2VolumeLayout.Items {
if vl != nil {
volumeLayout := vl.(*VolumeLayout)
copyCount := volumeLayout.rp.GetCopyCount()
for vid, locationList := range volumeLayout.vid2location {
if locationList.Length() < copyCount {
//set volume readonly
glog.V(0).Infoln("replicate volume :", vid)
}
}
}
}
}
return 0
}