LuciferYang commented on code in PR #36484:
URL: https://github.com/apache/spark/pull/36484#discussion_r867629141


##########
common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java:
##########
@@ -282,4 +273,24 @@ static int compare(byte[] a, byte[] b) {
     return a.length - b.length;
   }
 
+  static class LevelDBIteratorWeakReference extends 
WeakReference<LevelDBIterator<?>> {
+
+    private final DBIterator it;
+
+    LevelDBIteratorWeakReference(
+        LevelDBIterator<?> referent,
+        ReferenceQueue<? super LevelDBIterator<?>> q) {
+      super(referent, q);
+      it = referent.it;
+    }
+
+    public void close() {
+      try{

Review Comment:
   Unlike `RocksDBIterator`, `DBIterator.close()` may throw IOE. Since it is 
not be handled to when using the `Finalization` mechanism, it will not be 
handled here too . Or change to `com.google.common.io.Closeables.close(it, 
swallowIOException= false)` to log the exception?



-- 
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]

Reply via email to