diff options
| author | chrislu <chris.lu@gmail.com> | 2021-12-19 22:43:14 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2021-12-19 22:43:14 -0800 |
| commit | a152f179378319ab888cfbc0b4f0741f562faa64 (patch) | |
| tree | 0d3354a3fee668c108c9811b2f2bc790e6c59ff9 /weed/filer/filechunk_manifest.go | |
| parent | 85c526c583f6e1eb0a9499ba58fd9250ef25722d (diff) | |
| download | seaweedfs-a152f179378319ab888cfbc0b4f0741f562faa64.tar.xz seaweedfs-a152f179378319ab888cfbc0b4f0741f562faa64.zip | |
mount: improve read performance on random reads
Diffstat (limited to 'weed/filer/filechunk_manifest.go')
| -rw-r--r-- | weed/filer/filechunk_manifest.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go index 32008271b..b6a64b30d 100644 --- a/weed/filer/filechunk_manifest.go +++ b/weed/filer/filechunk_manifest.go @@ -101,6 +101,15 @@ func fetchChunk(lookupFileIdFn wdclient.LookupFileIdFunctionType, fileId string, return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, true, 0, 0) } +func fetchChunkRange(lookupFileIdFn wdclient.LookupFileIdFunctionType, fileId string, cipherKey []byte, isGzipped bool, offset int64, size int) ([]byte, error) { + urlStrings, err := lookupFileIdFn(fileId) + if err != nil { + glog.Errorf("operation LookupFileId %s failed, err: %v", fileId, err) + return nil, err + } + return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, false, offset, size) +} + func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, offset int64, size int) ([]byte, error) { var err error |
