views:

309

answers:

1

Hi,

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 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

+4  A: 

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.)

Kevin Bourrillion