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
This commit is contained in:
Chris Lu
2018-10-14 00:12:28 -07:00
parent 3ddcd87098
commit ff66269b62
16 changed files with 423 additions and 237 deletions

View File

@@ -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()