int size() {
    return map.size();
  }
Decrements the ref count of k, and removes from map if ref count == 0.

@param k the key to remove
@return the value associated with the specified key or null if key is removed from map.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RefCountingMap.java