aboutsummaryrefslogtreecommitdiff
path: root/weed/util/chunk_cache/chunk_cache.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-05-22 09:54:31 -0700
committerchrislu <chris.lu@gmail.com>2025-05-22 09:54:31 -0700
commit0d62be44846354c3c37b857028297edd4b8df17b (patch)
treec89320a7d58351030f1b740c7267f56bf0206429 /weed/util/chunk_cache/chunk_cache.go
parentd8c574a5ef1a811f9a0d447097d9edfcc0c1d84c (diff)
downloadseaweedfs-origin/changing-to-zap.tar.xz
seaweedfs-origin/changing-to-zap.zip
Diffstat (limited to 'weed/util/chunk_cache/chunk_cache.go')
-rw-r--r--weed/util/chunk_cache/chunk_cache.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go
index 7eee41b9b..b0affbcd4 100644
--- a/weed/util/chunk_cache/chunk_cache.go
+++ b/weed/util/chunk_cache/chunk_cache.go
@@ -4,7 +4,7 @@ import (
"errors"
"sync"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
)
@@ -66,13 +66,13 @@ func (c *TieredChunkCache) IsInCache(fileId string, lockNeeded bool) (answer boo
item := c.memCache.cache.Get(fileId)
if item != nil {
- glog.V(4).Infof("fileId %s is in memcache", fileId)
+ log.V(-1).Infof("fileId %s is in memcache", fileId)
return true
}
fid, err := needle.ParseFileIdFromString(fileId)
if err != nil {
- glog.V(4).Infof("failed to parse file id %s", fileId)
+ log.V(-1).Infof("failed to parse file id %s", fileId)
return false
}
@@ -80,7 +80,7 @@ func (c *TieredChunkCache) IsInCache(fileId string, lockNeeded bool) (answer boo
for k, v := range diskCacheLayer.diskCaches {
_, ok := v.nm.Get(fid.Key)
if ok {
- glog.V(4).Infof("fileId %s is in diskCaches[%d].volume[%d]", fileId, i, k)
+ log.V(-1).Infof("fileId %s is in diskCaches[%d].volume[%d]", fileId, i, k)
return true
}
}
@@ -100,7 +100,7 @@ func (c *TieredChunkCache) ReadChunkAt(data []byte, fileId string, offset uint64
if minSize <= c.onDiskCacheSizeLimit0 {
n, err = c.memCache.readChunkAt(data, fileId, offset)
if err != nil {
- glog.Errorf("failed to read from memcache: %s", err)
+ log.Errorf("failed to read from memcache: %s", err)
}
if n == int(len(data)) {
return n, nil
@@ -109,7 +109,7 @@ func (c *TieredChunkCache) ReadChunkAt(data []byte, fileId string, offset uint64
fid, err := needle.ParseFileIdFromString(fileId)
if err != nil {
- glog.Errorf("failed to parse file id %s", fileId)
+ log.Errorf("failed to parse file id %s", fileId)
return 0, nil
}
@@ -143,9 +143,9 @@ func (c *TieredChunkCache) SetChunk(fileId string, data []byte) {
c.Lock()
defer c.Unlock()
- glog.V(4).Infof("SetChunk %s size %d\n", fileId, len(data))
+ log.V(-1).Infof("SetChunk %s size %d\n", fileId, len(data))
if c.IsInCache(fileId, false) {
- glog.V(4).Infof("fileId %s is already in cache", fileId)
+ log.V(-1).Infof("fileId %s is already in cache", fileId)
return
}
@@ -160,7 +160,7 @@ func (c *TieredChunkCache) doSetChunk(fileId string, data []byte) {
fid, err := needle.ParseFileIdFromString(fileId)
if err != nil {
- glog.Errorf("failed to parse file id %s", fileId)
+ log.Errorf("failed to parse file id %s", fileId)
return
}