I am using java and my spark code/functionality is written across multiple methods. Usually I end up persisting dataframe in a particular method and not be able to unpersist wit