private void unsafeUnload ( LCMSDataSubset subset ) { //System.err.println("=========== UNLOAD (unsafe) CALLED ***********************"); // getting subsets loaded by all other users of this LCMSData ConcurrentMap < Object , Set < LCMSDataSubset > > otherUserMaps = cache . asMap ( ) ; HashSet < LCMSDataSubset > otherUsersSubsetsCombined = new HashSet <> ( ) ; for ( Map . Entry < Object , Set < LCMSDataSubset > > entry : otherUserMaps . entrySet ( ) ) { Set < LCMSDataSubset > otherUserSubsets = entry . getValue ( ) ; otherUsersSubsetsCombined . addAll ( otherUserSubsets ) ; // for (LCMSDataSubset otherSubset : otherUserSubsets) { // if (otherSubset != subset) { // otherUsersSubsetsCombined.add(otherSubset); // } // } } if ( otherUsersSubsetsCombined . isEmpty ( ) ) { scans . unloadData ( subset ) ; } else { scans . unloadData ( subset , otherUsersSubsetsCombined ) ; } }
Unloads the subset without checking the user . It s required by our user - tracking automatic cleanup if a user was GCed and it hasn t unloaded its subsets we detect the GC automatically and unload all the subsets used by this killed user . It will still check for other users using scans from this subset .