mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 08:46:54 +08:00
weed mount, weed dav add option to force cache
This commit is contained in:
@@ -23,14 +23,16 @@ type TieredChunkCache struct {
|
||||
onDiskCacheSizeLimit0 uint64
|
||||
onDiskCacheSizeLimit1 uint64
|
||||
onDiskCacheSizeLimit2 uint64
|
||||
forceCache bool
|
||||
}
|
||||
|
||||
var _ ChunkCache = &TieredChunkCache{}
|
||||
|
||||
func NewTieredChunkCache(maxEntries int64, dir string, diskSizeInUnit int64, unitSize int64) *TieredChunkCache {
|
||||
func NewTieredChunkCache(maxEntries int64, dir string, diskSizeInUnit int64, unitSize int64, forceCache bool) *TieredChunkCache {
|
||||
|
||||
c := &TieredChunkCache{
|
||||
memCache: NewChunkCacheInMemory(maxEntries),
|
||||
memCache: NewChunkCacheInMemory(maxEntries),
|
||||
forceCache: forceCache,
|
||||
}
|
||||
c.diskCaches = make([]*OnDiskCacheLayer, 3)
|
||||
c.onDiskCacheSizeLimit0 = uint64(unitSize)
|
||||
|
||||
@@ -13,7 +13,7 @@ func TestOnDisk(t *testing.T) {
|
||||
|
||||
totalDiskSizeInKB := int64(32)
|
||||
|
||||
cache := NewTieredChunkCache(2, tmpDir, totalDiskSizeInKB, 1024)
|
||||
cache := NewTieredChunkCache(2, tmpDir, totalDiskSizeInKB, 1024, false)
|
||||
|
||||
writeCount := 5
|
||||
type test_data struct {
|
||||
@@ -61,7 +61,7 @@ func TestOnDisk(t *testing.T) {
|
||||
|
||||
cache.Shutdown()
|
||||
|
||||
cache = NewTieredChunkCache(2, tmpDir, totalDiskSizeInKB, 1024)
|
||||
cache = NewTieredChunkCache(2, tmpDir, totalDiskSizeInKB, 1024, false)
|
||||
|
||||
for i := 0; i < 2; i++ {
|
||||
data := mem.Allocate(testData[i].size)
|
||||
|
||||
Reference in New Issue
Block a user