tiered caching

1/4 for small less than 1MB files. 1/4 for 1~4MB files, 1/2 for bigger than 4MB files
This commit is contained in:
Chris Lu
2020-04-13 22:19:27 -07:00
parent f282ed444b
commit 2b5c4fbbf3
5 changed files with 41 additions and 21 deletions

View File

@@ -14,10 +14,9 @@ func TestOnDisk(t *testing.T) {
tmpDir, _ := ioutil.TempDir("", "c")
defer os.RemoveAll(tmpDir)
totalDiskSizeMb := int64(6)
segmentCount := 2
totalDiskSizeMb := int64(32)
cache := NewChunkCache(0, tmpDir, totalDiskSizeMb, segmentCount)
cache := NewChunkCache(0, tmpDir, totalDiskSizeMb)
writeCount := 5
type test_data struct {
@@ -46,7 +45,7 @@ func TestOnDisk(t *testing.T) {
cache.Shutdown()
cache = NewChunkCache(0, tmpDir, totalDiskSizeMb, segmentCount)
cache = NewChunkCache(0, tmpDir, totalDiskSizeMb)
for i := 0; i < writeCount; i++ {
data := cache.GetChunk(testData[i].fileId, testData[i].size)