LuciferYang commented on code in PR #43502:
URL: https://github.com/apache/spark/pull/43502#discussion_r1369630645
##########
common/kvstore/src/main/java/org/apache/spark/util/kvstore/RocksDB.java:
##########
@@ -285,6 +288,7 @@ public Iterator<T> iterator() {
try {
RocksDBIterator<T> it = new RocksDBIterator<>(type, RocksDB.this,
this);
iteratorTracker.add(new WeakReference<>(it));
+ CLEANER.register(it, new
RocksDBIterator.ResourceCleaner(it.getRocksIterator(), _db, iteratorTracker));
Review Comment:
I think we should move `CLEANER` to RocksIterator, and also place the
registration process in the constructor of `RocksDBIterator`. Considering the
extensibility in the future, we should not assume that it will only be
registered in this one place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]