Generally overriding the finalize() method is an antipattern (it was in fact deprecated in java 11 https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()) . What’s the use case here?
If you control the codebase, you control when an RDD goes out of scope. Or am I missing something?
(Note that finalize will not necessarily executed when an object goes out of scope but when the GC runs at some indeterminate point in the future. Please avoid using finalize for the kind of task you're trying to do. It's not what it was designed for. Better to pay more attention to house-keeping in your own code.)
On Wed, Jun 12, 2019 at 9:11 PM Nasrulla Khan Haris <[hidden email]> wrote:
We cannot have control over RDD going out of scope from memory as it was handled by JVM. Thus I am not sure try and finalize will help.
Thus I wanted to use some mechanism to cleanup of some temporary data which is created by RDD immediately as soon as it goes out of scope.