Class ChangeNotesCache.Weigher

    • Constructor Detail

      • Weigher

        public Weigher()
    • 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 interface com.google.common.cache.Weigher<ChangeNotesCache.Key,​ChangeNotesState>