aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filechunk_manifest.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-08 23:19:42 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-08 23:19:42 -0700
commit6e1f936efd5b28ef15c2f3b388f07c34bbdb527b (patch)
tree8cc328751d21489cd27d480b0bfa0665570714ea /weed/filer/filechunk_manifest.go
parentb2ee5873fbec831a480bdf62be20c649a09b49ba (diff)
downloadseaweedfs-6e1f936efd5b28ef15c2f3b388f07c34bbdb527b.tar.xz
seaweedfs-6e1f936efd5b28ef15c2f3b388f07c34bbdb527b.zip
refactoring
Diffstat (limited to 'weed/filer/filechunk_manifest.go')
-rw-r--r--weed/filer/filechunk_manifest.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go
index fabb7f879..200fde438 100644
--- a/weed/filer/filechunk_manifest.go
+++ b/weed/filer/filechunk_manifest.go
@@ -89,10 +89,15 @@ func fetchChunk(lookupFileIdFn LookupFileIdFunctionType, fileId string, cipherKe
glog.Errorf("operation LookupFileId %s failed, err: %v", fileId, err)
return nil, err
}
- var buffer bytes.Buffer
+ return fetchChunkData(urlStrings, cipherKey, isGzipped, true, 0, 0)
+}
+func fetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, offset int64, size int) ([]byte, error) {
+
+ var err error
+ var buffer bytes.Buffer
for _, urlString := range urlStrings {
- err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, true, 0, 0, func(data []byte) {
+ err = util.ReadUrlAsStream(urlString, cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
buffer.Write(data)
})
if err != nil {