aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-10-14 00:12:28 -0700
committerChris Lu <chris.lu@gmail.com>2018-10-14 00:12:28 -0700
commitff66269b62ddffe70127bbb9835ae5e7b24e8ce7 (patch)
tree469ac5785c44913288437e2ca765042583aeba28 /weed/wdclient
parent3ddcd870983e68e24ad569127f9a989d7bc986dc (diff)
downloadseaweedfs-ff66269b62ddffe70127bbb9835ae5e7b24e8ce7.tar.xz
seaweedfs-ff66269b62ddffe70127bbb9835ae5e7b24e8ce7.zip
use grpc to replace http APIs for batch volume id lookup and batch delete
1. remove batch volume id lookup http API /vol/lookup 2. remove batch delete http API /delete
Diffstat (limited to 'weed/wdclient')
-rw-r--r--weed/wdclient/vid_map.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/wdclient/vid_map.go b/weed/wdclient/vid_map.go
index 2f56b8fce..166c05b0a 100644
--- a/weed/wdclient/vid_map.go
+++ b/weed/wdclient/vid_map.go
@@ -54,6 +54,19 @@ func (vc *vidMap) LookupFileId(fileId string) (fullUrl string, err error) {
return "http://" + serverUrl + "/" + fileId, nil
}
+func (vc *vidMap) LookupVolumeServer(fileId string) (volumeServer string, err error) {
+ parts := strings.Split(fileId, ",")
+ if len(parts) != 2 {
+ return "", errors.New("Invalid fileId " + fileId)
+ }
+ serverUrl, lookupError := vc.LookupVolumeServerUrl(parts[0])
+ if lookupError != nil {
+ return "", lookupError
+ }
+ return serverUrl, nil
+}
+
+
func (vc *vidMap) GetLocations(vid uint32) (locations []Location) {
vc.RLock()
defer vc.RUnlock()