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 Constructor Description Weigher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
weigh(ChangeNotesCache.Key key, ChangeNotesState state)
-
-
-
Method Detail
-
weigh
public int weigh(ChangeNotesCache.Key key, ChangeNotesState state)
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>
-
-