refactor: remove unused parameter
This commit is contained in:
@@ -91,10 +91,10 @@ func fetchChunk(lookupFileIdFn wdclient.LookupFileIdFunctionType, fileId string,
|
|||||||
glog.Errorf("operation LookupFileId %s failed, err: %v", fileId, err)
|
glog.Errorf("operation LookupFileId %s failed, err: %v", fileId, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, true, false, 0, 0)
|
return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, true, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, isCheck bool, offset int64, size int) ([]byte, error) {
|
func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, offset int64, size int) ([]byte, error) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var shouldRetry bool
|
var shouldRetry bool
|
||||||
|
|||||||
@@ -48,15 +48,7 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c
|
|||||||
for _, chunkView := range chunkViews {
|
for _, chunkView := range chunkViews {
|
||||||
|
|
||||||
urlStrings := fileId2Url[chunkView.FileId]
|
urlStrings := fileId2Url[chunkView.FileId]
|
||||||
data, err := retriedFetchChunkData(
|
data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size))
|
||||||
urlStrings,
|
|
||||||
chunkView.CipherKey,
|
|
||||||
chunkView.IsGzipped,
|
|
||||||
chunkView.IsFullChunk(),
|
|
||||||
false,
|
|
||||||
chunkView.Offset,
|
|
||||||
int(chunkView.Size),
|
|
||||||
)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("read chunk: %v", err)
|
glog.Errorf("read chunk: %v", err)
|
||||||
return fmt.Errorf("read chunk: %v", err)
|
return fmt.Errorf("read chunk: %v", err)
|
||||||
@@ -78,14 +70,7 @@ func CheckAllChunkViews(chunkViews []*ChunkView, fileId2Url *map[string][]string
|
|||||||
urlStrings := (*fileId2Url)[chunkView.FileId]
|
urlStrings := (*fileId2Url)[chunkView.FileId]
|
||||||
glog.V(9).Infof("Check chunk: %+v\n url: %v", chunkView, urlStrings)
|
glog.V(9).Infof("Check chunk: %+v\n url: %v", chunkView, urlStrings)
|
||||||
gErr.Go(func() error {
|
gErr.Go(func() error {
|
||||||
_, err := retriedFetchChunkData(
|
_, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size))
|
||||||
urlStrings,
|
|
||||||
chunkView.CipherKey,
|
|
||||||
chunkView.IsGzipped,
|
|
||||||
chunkView.IsFullChunk(),
|
|
||||||
true,
|
|
||||||
chunkView.Offset,
|
|
||||||
int(chunkView.Size))
|
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -110,7 +95,7 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), false, chunkView.Offset, int(chunkView.Size))
|
data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user