Package com.google.gerrit.server.notedb
Class ChangeNotesCache.Weigher
java.lang.Object
com.google.gerrit.server.notedb.ChangeNotesCache.Weigher
- All Implemented Interfaces:
com.google.common.cache.Weigher<ChangeNotesCache.Key,
ChangeNotesState>
- Enclosing class:
- ChangeNotesCache
public static class ChangeNotesCache.Weigher
extends Object
implements com.google.common.cache.Weigher<ChangeNotesCache.Key,ChangeNotesState>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Weigher
public Weigher()
-
-
Method Details
-
weigh
Take all columns and all collection sizes into account, but use estimated average element sizes rather than iterating over collections. Numbers are largely hand-wavy based on http://stackoverflow.com/questions/258120/what-is-the-memory-consumption-of-an-object-in-java
Should be kept up to date with
ChangeNotesState
. Please, keep weights listed in the same order as fields.- Specified by:
weigh
in interfacecom.google.common.cache.Weigher<ChangeNotesCache.Key,
ChangeNotesState>
-