aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-28 13:42:35 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-28 13:42:35 -0700
commit4aa82c95e6130b3eaa785f079a97552f354cefc4 (patch)
tree569f1b19ee9f33c5a24424adbfe57b8ce259354b
parenteedd33dda32e2725c333f25d414231a8c7688485 (diff)
downloadseaweedfs-4aa82c95e6130b3eaa785f079a97552f354cefc4.tar.xz
seaweedfs-4aa82c95e6130b3eaa785f079a97552f354cefc4.zip
refactor
-rw-r--r--weed/filer2/filechunks.go4
-rw-r--r--weed/filer2/stream.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.go
index 4c972e14f..0c93c389b 100644
--- a/weed/filer2/filechunks.go
+++ b/weed/filer2/filechunks.go
@@ -73,7 +73,7 @@ type ChunkView struct {
LogicOffset int64
IsFullChunk bool
CipherKey []byte
- isGzipped bool
+ IsGzipped bool
}
func ViewFromChunks(chunks []*filer_pb.FileChunk, offset int64, size int64) (views []*ChunkView) {
@@ -105,7 +105,7 @@ func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int
LogicOffset: offset,
IsFullChunk: isFullChunk,
CipherKey: chunk.cipherKey,
- isGzipped: chunk.isGzipped,
+ IsGzipped: chunk.isGzipped,
})
offset = min(chunk.stop, stop)
}
diff --git a/weed/filer2/stream.go b/weed/filer2/stream.go
index b5ced696a..bf3781ae2 100644
--- a/weed/filer2/stream.go
+++ b/weed/filer2/stream.go
@@ -31,7 +31,7 @@ func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*f
for _, chunkView := range chunkViews {
urlString := fileId2Url[chunkView.FileId]
- err := util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.isGzipped, chunkView.IsFullChunk, chunkView.Offset, int(chunkView.Size), func(data []byte) {
+ err := util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk, chunkView.Offset, int(chunkView.Size), func(data []byte) {
w.Write(data)
})
if err != nil {
@@ -128,7 +128,7 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error {
return err
}
var buffer bytes.Buffer
- err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.isGzipped, chunkView.IsFullChunk, chunkView.Offset, int(chunkView.Size), func(data []byte) {
+ err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk, chunkView.Offset, int(chunkView.Size), func(data []byte) {
buffer.Write(data)
})
if err != nil {