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:
ZanderXu 2022-10-09 18:58:09 +08:00 committed by GitHub
parent 5eddec8c46
commit b0bfd09c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,7 @@ public int get(T t) {
} }
Integer old = t2i.putIfAbsent(t, sn); Integer old = t2i.putIfAbsent(t, sn);
if (old != null) { if (old != null) {
current.getAndDecrement();
return old; return old;
} }
i2t.put(sn, t); i2t.put(sn, t);