aboutsummaryrefslogtreecommitdiff
path: root/weed/util/chunk_cache/on_disk_cache_layer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-27 10:41:29 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-27 10:41:29 -0700
commit31fc7bb2e1fa6085e0d9f3309e8ec54641e1f70c (patch)
tree7b31849963e709d7ce29b0468d365fff18cd3299 /weed/util/chunk_cache/on_disk_cache_layer.go
parenta37535cd9fe4dc739aa4beda51878c5e22ecbdf8 (diff)
downloadseaweedfs-31fc7bb2e1fa6085e0d9f3309e8ec54641e1f70c.tar.xz
seaweedfs-31fc7bb2e1fa6085e0d9f3309e8ec54641e1f70c.zip
refactor
adjust for faster test
Diffstat (limited to 'weed/util/chunk_cache/on_disk_cache_layer.go')
-rw-r--r--weed/util/chunk_cache/on_disk_cache_layer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/util/chunk_cache/on_disk_cache_layer.go b/weed/util/chunk_cache/on_disk_cache_layer.go
index c3192b548..a4d786510 100644
--- a/weed/util/chunk_cache/on_disk_cache_layer.go
+++ b/weed/util/chunk_cache/on_disk_cache_layer.go
@@ -14,11 +14,11 @@ type OnDiskCacheLayer struct {
diskCaches []*ChunkCacheVolume
}
-func NewOnDiskCacheLayer(dir, namePrefix string, diskSizeMB int64, segmentCount int) *OnDiskCacheLayer {
+func NewOnDiskCacheLayer(dir, namePrefix string, diskSize int64, segmentCount int) *OnDiskCacheLayer {
- volumeCount, volumeSize := int(diskSizeMB/30000), int64(30000)
+ volumeCount, volumeSize := int(diskSize/(30000*1024*1024)), int64(30000*1024*1024)
if volumeCount < segmentCount {
- volumeCount, volumeSize = segmentCount, diskSizeMB/int64(segmentCount)
+ volumeCount, volumeSize = segmentCount, diskSize/int64(segmentCount)
}
c := &OnDiskCacheLayer{}