mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-07-15 19:43:18 +08:00
fix tests
This commit is contained in:
parent
2bc6fa90ff
commit
b541e39a2c
@ -175,10 +175,6 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) {
|
|||||||
|
|
||||||
func (c *ChunkReadAt) readChunkSlice(chunkView *ChunkView, nextChunkViews *ChunkView, offset, length uint64) ([]byte, error) {
|
func (c *ChunkReadAt) readChunkSlice(chunkView *ChunkView, nextChunkViews *ChunkView, offset, length uint64) ([]byte, error) {
|
||||||
|
|
||||||
if c.readerPattern.IsRandomMode() {
|
|
||||||
return c.doFetchRangeChunkData(chunkView, offset, length)
|
|
||||||
}
|
|
||||||
|
|
||||||
var chunkSlice []byte
|
var chunkSlice []byte
|
||||||
if chunkView.LogicOffset == 0 {
|
if chunkView.LogicOffset == 0 {
|
||||||
chunkSlice = c.chunkCache.GetChunkSlice(chunkView.FileId, offset, length)
|
chunkSlice = c.chunkCache.GetChunkSlice(chunkView.FileId, offset, length)
|
||||||
@ -189,6 +185,9 @@ func (c *ChunkReadAt) readChunkSlice(chunkView *ChunkView, nextChunkViews *Chunk
|
|||||||
if c.lookupFileId == nil {
|
if c.lookupFileId == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
if c.readerPattern.IsRandomMode() {
|
||||||
|
return c.doFetchRangeChunkData(chunkView, offset, length)
|
||||||
|
}
|
||||||
chunkData, err := c.readFromWholeChunkData(chunkView, nextChunkViews)
|
chunkData, err := c.readFromWholeChunkData(chunkView, nextChunkViews)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user