I understand ReferenceMap from the alpha version of Google Collections has been replaced by MapMaker.
I used this ReferenceMap constructor with the backing map:
public ReferenceMap(ReferenceType keyReferenceType, ReferenceType
valueReferenceType, ConcurrentMap<Object, Object> backingMap) {
this(keyReferenceType, valueReferenceType, backingMap, true);
}
My backing map is a concurrentmap with the ability to collect statistics (hit/miss etc).
开发者_运维百科What can I use in place of the above ReferenceMap constructor?
Thanks, Grace
We were not able to continue to offer the ability to pass your own backing map. MapMaker works using a customized map implementation of its own.
But, to gather hit/miss statistics, you can wrap the returned ConcurrentMap in a ForwardingConcurrentMap to count get
invocations (using an AtomicLong), and have your Function count misses in a similar way. (Hits being, of course, nearly equal to request minus misses.)
精彩评论