mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
remove unused function
This commit is contained in:
parent
ca80199ccd
commit
dc481c081c
@ -2,7 +2,6 @@ package filer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/remote_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/remote_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
@ -12,19 +11,6 @@ func (entry *Entry) IsInRemoteOnly() bool {
|
|||||||
return len(entry.Chunks) == 0 && entry.Remote != nil && entry.Remote.RemoteSize > 0
|
return len(entry.Chunks) == 0 && entry.Remote != nil && entry.Remote.RemoteSize > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Filer) ReadRemote(entry *Entry, offset int64, size int64) (data []byte, err error) {
|
|
||||||
client, _, found := f.RemoteStorage.GetRemoteStorageClient(entry.Remote.StorageName)
|
|
||||||
if !found {
|
|
||||||
return nil, fmt.Errorf("remote storage %v not found", entry.Remote.StorageName)
|
|
||||||
}
|
|
||||||
|
|
||||||
mountDir, remoteLoation := f.RemoteStorage.FindMountDirectory(entry.FullPath)
|
|
||||||
|
|
||||||
sourceLoc := MapFullPathToRemoteStorageLocation(mountDir, remoteLoation, entry.FullPath)
|
|
||||||
|
|
||||||
return client.ReadFile(sourceLoc, offset, size)
|
|
||||||
}
|
|
||||||
|
|
||||||
func MapFullPathToRemoteStorageLocation(localMountedDir util.FullPath, remoteMountedLocation *remote_pb.RemoteStorageLocation, fp util.FullPath) *remote_pb.RemoteStorageLocation {
|
func MapFullPathToRemoteStorageLocation(localMountedDir util.FullPath, remoteMountedLocation *remote_pb.RemoteStorageLocation, fp util.FullPath) *remote_pb.RemoteStorageLocation {
|
||||||
remoteLocation := &remote_pb.RemoteStorageLocation{
|
remoteLocation := &remote_pb.RemoteStorageLocation{
|
||||||
Name: remoteMountedLocation.Name,
|
Name: remoteMountedLocation.Name,
|
||||||
|
Loading…
Reference in New Issue
Block a user