| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.locks.Lock |
lock
Lock protecting the list
|
private ExplicitList<LRUCache.CacheEntry> |
mostRecentVersions
List of entries representing most recent versions
|
private int |
numSnapshotsCreated
Number of snaphot versions created
|
private ExplicitList<LRUCache.CacheEntry> |
snapshotVersions
List of snapshot entries
|
| Modifier | Constructor and Description |
|---|---|
private |
LRU() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToLRU(LRUCache.CacheEntry entry)
add the new entry to the head of the lru
|
void |
addToSnapshots(LRUCache.CacheEntry entry)
Removes the entry from the lru list and Adds the entry to the list of snapshot entries.
|
LRUCache.CacheEntry |
findVictim(int latchIndex)
Finds a freeable entry from the lru.
|
java.util.concurrent.locks.Lock |
getLock() |
void |
moveToTail(LRUCache.CacheEntry entry)
Moves the entry to the cold end of the lru.
|
void |
touch(LRUCache.CacheEntry entry)
Increases the hotness of the given entry
|
private ExplicitList<LRUCache.CacheEntry> mostRecentVersions
private ExplicitList<LRUCache.CacheEntry> snapshotVersions
private java.util.concurrent.locks.Lock lock
private int numSnapshotsCreated
public java.util.concurrent.locks.Lock getLock()
public void addToLRU(LRUCache.CacheEntry entry)
entry - new entry to be addedpublic void addToSnapshots(LRUCache.CacheEntry entry)
entry - cache entry to be made snapshotpublic void moveToTail(LRUCache.CacheEntry entry)
entry - entry to be made coldpublic void touch(LRUCache.CacheEntry entry)
entry - cache entry for which we will increase hotnesspublic LRUCache.CacheEntry findVictim(int latchIndex)
latchIndex - index of the hash lock that is held at entry