我有这个ConcurrentMap
ConcurrentMap<String, Byte[]> companyLogo = new MapMaker()
.concurrencyLevel(Runtime.getRuntime().availableProcessors())
.weakKeys()
.initialCapacity(1000)
.expiration(24, TimeUnit.HOURS)
.makeMap();
和这段代码
companyLogo.put("cpr48124", ArrayUtils.toObject(resize (request, ((Byte[])request.getSession().getAttribute(COMPANY_LOGO_KEY+ imageId)))));
companyLogo.get("cpr48124");
但companyLogo.get("cpr48124");
为空。怎么可能呢?
答案 0 :(得分:1)
我不熟悉MapMaker
,但我猜你weakKeys
可能是你的问题。
可能是“弱点”&#39;您的新条目正在使其无法使用,因为没有其它参考。