diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-17 20:20:08 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-17 20:20:08 -0700 |
| commit | 09e126bae50dac2fe2dee2b074789c6c6e06bf8c (patch) | |
| tree | 822928c00f5f6488d92cb30210b294da55d15875 /weed/util/chunk_cache | |
| parent | be4d42b8e2bffd4a5ff650611f2cfb8c058ca26b (diff) | |
| download | seaweedfs-09e126bae50dac2fe2dee2b074789c6c6e06bf8c.tar.xz seaweedfs-09e126bae50dac2fe2dee2b074789c6c6e06bf8c.zip | |
refactoring: use interface
Diffstat (limited to 'weed/util/chunk_cache')
| -rw-r--r-- | weed/util/chunk_cache/chunk_cache.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index d01e2163b..a1a054215 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -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 |
