mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactoring
This commit is contained in:
parent
d79f0a76b1
commit
5ebc95b69b
|
@ -6,14 +6,14 @@ import (
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/operation"
|
"github.com/chrislusf/seaweedfs/weed/operation"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (f *Filer) loopProcessingDeletion() {
|
func LookupByMasterClientFn(masterClient *wdclient.MasterClient) func(vids []string) (map[string]operation.LookupResult, error) {
|
||||||
|
return func(vids []string) (map[string]operation.LookupResult, error) {
|
||||||
lookupFunc := func(vids []string) (map[string]operation.LookupResult, error) {
|
|
||||||
m := make(map[string]operation.LookupResult)
|
m := make(map[string]operation.LookupResult)
|
||||||
for _, vid := range vids {
|
for _, vid := range vids {
|
||||||
locs, _ := f.MasterClient.GetVidLocations(vid)
|
locs, _ := masterClient.GetVidLocations(vid)
|
||||||
var locations []operation.Location
|
var locations []operation.Location
|
||||||
for _, loc := range locs {
|
for _, loc := range locs {
|
||||||
locations = append(locations, operation.Location{
|
locations = append(locations, operation.Location{
|
||||||
|
@ -28,6 +28,11 @@ func (f *Filer) loopProcessingDeletion() {
|
||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *Filer) loopProcessingDeletion() {
|
||||||
|
|
||||||
|
lookupFunc := LookupByMasterClientFn(f.MasterClient)
|
||||||
|
|
||||||
var deletionCount int
|
var deletionCount int
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in a new issue