aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/stream.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-06 04:21:34 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-06 04:22:00 -0800
commit2b7685464139e8fbfedbb357f72c4ff70bd869e1 (patch)
tree74ee5a6e9f15003bc659da47a8a806bcfdb6a416 /weed/filer/stream.go
parent95ecf0c72f57f7b8cc96cb9099b79bc8ead9b80d (diff)
downloadseaweedfs-2b7685464139e8fbfedbb357f72c4ff70bd869e1.tar.xz
seaweedfs-2b7685464139e8fbfedbb357f72c4ff70bd869e1.zip
add "weed filer.cat" to read files directly from volume servers
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{})