mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 00:43:32 +08:00
weed mount caching
This commit is contained in:
@@ -7,9 +7,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/seaweedfs/seaweedfs/weed/util/chunk_cache"
|
"github.com/seaweedfs/seaweedfs/weed/util/chunk_cache"
|
||||||
|
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/util/mem"
|
"github.com/seaweedfs/seaweedfs/weed/util/mem"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/wdclient"
|
"github.com/seaweedfs/seaweedfs/weed/wdclient"
|
||||||
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ReaderCache struct {
|
type ReaderCache struct {
|
||||||
@@ -69,7 +69,7 @@ func (rc *ReaderCache) MaybeCache(chunkViews *Interval[*ChunkView]) {
|
|||||||
|
|
||||||
// glog.V(4).Infof("prefetch %s offset %d", chunkView.FileId, chunkView.ViewOffset)
|
// glog.V(4).Infof("prefetch %s offset %d", chunkView.FileId, chunkView.ViewOffset)
|
||||||
// cache this chunk if not yet
|
// cache this chunk if not yet
|
||||||
cacher := newSingleChunkCacher(rc, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int(chunkView.ChunkSize), false)
|
cacher := newSingleChunkCacher(rc, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int(chunkView.ChunkSize), chunkView.ViewOffset == 0)
|
||||||
go cacher.startCaching()
|
go cacher.startCaching()
|
||||||
<-cacher.cacheStartedCh
|
<-cacher.cacheStartedCh
|
||||||
rc.downloaders[chunkView.FileId] = cacher
|
rc.downloaders[chunkView.FileId] = cacher
|
||||||
|
Reference in New Issue
Block a user