diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-12 05:59:52 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-12 05:59:52 -0800 |
| commit | 7d9dc3c6a273e21d719605a650504a30e545b078 (patch) | |
| tree | fdcecf9ba99f7a88cab976c6879c338408e26fc6 /weed/filer | |
| parent | 487e435679d6c8cc153b8ef048b8957478cd3d0c (diff) | |
| download | seaweedfs-7d9dc3c6a273e21d719605a650504a30e545b078.tar.xz seaweedfs-7d9dc3c6a273e21d719605a650504a30e545b078.zip | |
use fasthttp lib to read
Diffstat (limited to 'weed/filer')
| -rw-r--r-- | weed/filer/filechunk_manifest.go | 2 | ||||
| -rw-r--r-- | weed/filer/read_write.go | 2 | ||||
| -rw-r--r-- | weed/filer/stream.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go index 845bfaec1..99a62c90c 100644 --- a/weed/filer/filechunk_manifest.go +++ b/weed/filer/filechunk_manifest.go @@ -102,7 +102,7 @@ func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool for waitTime := time.Second; waitTime < util.RetryWaitTime; waitTime += waitTime / 2 { for _, urlString := range urlStrings { - shouldRetry, err = util.ReadUrlAsStream(urlString+"?readDeleted=true", cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) { + shouldRetry, err = util.FastReadUrlAsStream(urlString+"?readDeleted=true", cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) { buffer.Write(data) }) if !shouldRetry { diff --git a/weed/filer/read_write.go b/weed/filer/read_write.go index 1f78057ef..7a6da3beb 100644 --- a/weed/filer/read_write.go +++ b/weed/filer/read_write.go @@ -35,7 +35,7 @@ func ReadContent(filerAddress string, dir, name string) ([]byte, error) { target := fmt.Sprintf("http://%s%s/%s", filerAddress, dir, name) - data, _, err := util.Get(target) + data, _, err := util.FastGet(target) return data, err } diff --git a/weed/filer/stream.go b/weed/filer/stream.go index f0042a0ff..075204b79 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -181,7 +181,7 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error { var buffer bytes.Buffer var shouldRetry bool for _, urlString := range urlStrings { - shouldRetry, err = util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + shouldRetry, err = util.FastReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { buffer.Write(data) }) if !shouldRetry { |
