You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/10 00:29:28 UTC

[GitHub] [spark] HeartSaVioR edited a comment on pull request #28769: [SPARK-31929][WEBUI] Close leveldbiterator when leveldb.close

HeartSaVioR edited a comment on pull request #28769:
URL: https://github.com/apache/spark/pull/28769#issuecomment-641649819


   I guess the interface matters - in-memory KV store doesn't need to have close in its iterator of course (it has, but no-op), but level DB KV store should. The code picked "Iterator" as common denominator which doesn't have "close" on it, so the caller has no idea whether it should call close or not, and once it's wrapped by others like asScala or so, the caller will never be able to call close afterwards. The implementation of iterator implements Closeable, but the caller is on Scala - can't rely on Java language's try-with-resource.
   
   I don't know the interface is public - I don't see any usage of KV store "outside" Spark or any plug-in interface to provide custom implementation of KV store "into" Spark - if it's private it'd be better to return KVStoreIterator, with making sure callers must call close.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org