mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-02-09 09:17:28 +08:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user