diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-25 02:20:19 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-25 02:20:19 -0700 |
| commit | 5ebc95b69bad1014980c5165d7cb382ace296880 (patch) | |
| tree | 82084d351fa22c8f0d99e39c6ef7c9d29b25c7d8 | |
| parent | d79f0a76b10c268023fbaaf27e9b3dda7715c10f (diff) | |
| download | seaweedfs-5ebc95b69bad1014980c5165d7cb382ace296880.tar.xz seaweedfs-5ebc95b69bad1014980c5165d7cb382ace296880.zip | |
refactoring
| -rw-r--r-- | weed/filer2/filer_deletion.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/weed/filer2/filer_deletion.go b/weed/filer2/filer_deletion.go index 8c0e159b5..e463e9e6a 100644 --- a/weed/filer2/filer_deletion.go +++ b/weed/filer2/filer_deletion.go @@ -6,14 +6,14 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" + "github.com/chrislusf/seaweedfs/weed/wdclient" ) -func (f *Filer) loopProcessingDeletion() { - - lookupFunc := func(vids []string) (map[string]operation.LookupResult, error) { +func LookupByMasterClientFn(masterClient *wdclient.MasterClient) func(vids []string) (map[string]operation.LookupResult, error) { + return func(vids []string) (map[string]operation.LookupResult, error) { m := make(map[string]operation.LookupResult) for _, vid := range vids { - locs, _ := f.MasterClient.GetVidLocations(vid) + locs, _ := masterClient.GetVidLocations(vid) var locations []operation.Location for _, loc := range locs { locations = append(locations, operation.Location{ @@ -28,6 +28,11 @@ func (f *Filer) loopProcessingDeletion() { } return m, nil } +} + +func (f *Filer) loopProcessingDeletion() { + + lookupFunc := LookupByMasterClientFn(f.MasterClient) var deletionCount int for { |
