refactoring: use interface

This commit is contained in:
Chris Lu
2020-08-17 20:20:08 -07:00
parent be4d42b8e2
commit 09e126bae5
2 changed files with 8 additions and 3 deletions

View File

@@ -13,6 +13,11 @@ const (
onDiskCacheSizeLimit1 = 4 * memCacheSizeLimit
)
type ChunkCache interface {
GetChunk(fileId string, minSize uint64) (data []byte)
SetChunk(fileId string, data []byte)
}
// a global cache for recently accessed file chunks
type TieredChunkCache struct {
memCache *ChunkCacheInMemory