aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/stream.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-21 00:47:27 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-21 00:47:27 -0800
commita9e6db1a8e964f10571a5e11c197fd2da141c6f7 (patch)
tree0a22db3d6c68178d8e913c1bffd550ae4127a7e1 /weed/filer/stream.go
parentf0455dee683e831487c345a575b7894c0e2bf61a (diff)
parent84f05787f8eecfcb61e49882346ad5855b6bb784 (diff)
downloadseaweedfs-origin/ftp.tar.xz
seaweedfs-origin/ftp.zip
Merge branch 'master' into ftporigin/ftp
Diffstat (limited to 'weed/filer/stream.go')
-rw-r--r--weed/filer/stream.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/filer/stream.go b/weed/filer/stream.go
index cffdc8303..f0042a0ff 100644
--- a/weed/filer/stream.go
+++ b/weed/filer/stream.go
@@ -13,16 +13,16 @@ import (
"github.com/chrislusf/seaweedfs/weed/wdclient"
)
-func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*filer_pb.FileChunk, offset int64, size int64) error {
+func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, chunks []*filer_pb.FileChunk, offset int64, size int64) error {
// fmt.Printf("start to stream content for chunks: %+v\n", chunks)
- chunkViews := ViewFromChunks(masterClient.LookupFileId, chunks, offset, size)
+ chunkViews := ViewFromChunks(masterClient.GetLookupFileIdFunction(), chunks, offset, size)
fileId2Url := make(map[string][]string)
for _, chunkView := range chunkViews {
- urlStrings, err := masterClient.LookupFileId(chunkView.FileId)
+ urlStrings, err := masterClient.GetLookupFileIdFunction()(chunkView.FileId)
if err != nil {
glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err)
return err
@@ -86,7 +86,7 @@ type ChunkStreamReader struct {
bufferOffset int64
bufferPos int
chunkIndex int
- lookupFileId LookupFileIdFunctionType
+ lookupFileId wdclient.LookupFileIdFunctionType
}
var _ = io.ReadSeeker(&ChunkStreamReader{})