Renamed eviction2 import alias to eviction

This commit is contained in:
Kelvin Mwinuka
2024-03-26 13:53:42 +08:00
parent 7cec2da854
commit a3fbbd1243

View File

@@ -22,7 +22,7 @@ import (
"fmt"
"github.com/echovault/echovault/internal"
"github.com/echovault/echovault/internal/aof"
eviction2 "github.com/echovault/echovault/internal/eviction"
"github.com/echovault/echovault/internal/eviction"
"github.com/echovault/echovault/internal/memberlist"
"github.com/echovault/echovault/internal/raft"
"github.com/echovault/echovault/internal/snapshot"
@@ -56,13 +56,13 @@ type EchoVault struct {
}
// LFU cache used when eviction policy is allkeys-lfu or volatile-lfu
lfuCache struct {
mutex sync.Mutex // Mutex as only one goroutine can edit the LFU cache at a time.
cache eviction2.CacheLFU // LFU cache represented by a min head.
mutex sync.Mutex // Mutex as only one goroutine can edit the LFU cache at a time.
cache eviction.CacheLFU // LFU cache represented by a min head.
}
// LRU cache used when eviction policy is allkeys-lru or volatile-lru
lruCache struct {
mutex sync.Mutex // Mutex as only one goroutine can edit the LRU at a time.
cache eviction2.CacheLRU // LRU cache represented by a max head.
mutex sync.Mutex // Mutex as only one goroutine can edit the LRU at a time.
cache eviction.CacheLRU // LRU cache represented by a max head.
}
// Holds the list of all commands supported by the echovault.
@@ -466,17 +466,17 @@ func (server *EchoVault) initialiseCaches() {
// Set up LFU cache
server.lfuCache = struct {
mutex sync.Mutex
cache eviction2.CacheLFU
cache eviction.CacheLFU
}{
mutex: sync.Mutex{},
cache: eviction2.NewCacheLFU(),
cache: eviction.NewCacheLFU(),
}
// set up LRU cache
server.lruCache = struct {
mutex sync.Mutex
cache eviction2.CacheLRU
cache eviction.CacheLRU
}{
mutex: sync.Mutex{},
cache: eviction2.NewCacheLRU(),
cache: eviction.NewCacheLRU(),
}
}