HDFS-16798. HDFS-16798. SerialNumberMap should decrease current counter if the item exist. (#4987). Contributed by ZanderXu.
Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
parent
5eddec8c46
commit
b0bfd09c41
@ -68,6 +68,7 @@ public int get(T t) {
|
||||
}
|
||||
Integer old = t2i.putIfAbsent(t, sn);
|
||||
if (old != null) {
|
||||
current.getAndDecrement();
|
||||
return old;
|
||||
}
|
||||
i2t.put(sn, t);
|
||||
|
Loading…
Reference in New Issue
Block a user