相关用例:
read input
if (correlation-id is already generated for this input)
{
lookup the correlation-id from the cache;
return correlation-id;
}
else
{
generate the correlation-id;
cache it;
return correlation-id;
}
约束: - 输入记录的数量可以达到 500K,因此不想使用强引用。- 目前不想生成单向哈希(我知道如果我们使用单向哈希,则不需要缓存)
有人可以告诉我如何为此使用 ComputingMap。我问这个是因为 javadoc 中有一条注释说“它对弱/软键使用身份相等”。