|
@ -32,7 +32,7 @@ func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*f |
|
|
for _, chunkView := range chunkViews { |
|
|
for _, chunkView := range chunkViews { |
|
|
|
|
|
|
|
|
urlString := fileId2Url[chunkView.FileId] |
|
|
urlString := fileId2Url[chunkView.FileId] |
|
|
err := util.ReadUrlAsStream(urlString+"?readDeleted=true", 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) |
|
|
w.Write(data) |
|
|
}) |
|
|
}) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@ -63,7 +63,7 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) |
|
|
glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err) |
|
|
glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err) |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
err = util.ReadUrlAsStream(urlString+"?readDeleted=true", 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) |
|
|
buffer.Write(data) |
|
|
}) |
|
|
}) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@ -175,7 +175,7 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
var buffer bytes.Buffer |
|
|
var buffer bytes.Buffer |
|
|
err = util.ReadUrlAsStream(urlString+"?readDeleted=true", 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) |
|
|
buffer.Write(data) |
|
|
}) |
|
|
}) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|