mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
create MapClosable which replaces the default isClosed() method that was removed from chronicle closable
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.core.io.Closeable;
|
||||
import net.openhft.chronicle.core.io.DefaultCloseable;
|
||||
import net.openhft.chronicle.hash.ChronicleHashBuilderPrivateAPI;
|
||||
import net.openhft.chronicle.hash.ReplicatedHashSegmentContext;
|
||||
import net.openhft.chronicle.hash.replication.ReplicableEntry;
|
||||
@@ -34,14 +34,13 @@ import static net.openhft.chronicle.hash.replication.TimeProvider.currentTime;
|
||||
import static net.openhft.chronicle.hash.replication.TimeProvider.systemTimeIntervalBetween;
|
||||
|
||||
class OldDeletedEntriesCleanupThread extends Thread
|
||||
implements Closeable, Predicate<ReplicableEntry> {
|
||||
implements DefaultCloseable, Predicate<ReplicableEntry> {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(OldDeletedEntriesCleanupThread.class);
|
||||
|
||||
/**
|
||||
* Don't store a strong ref to a map in order to avoid it's leaking, if the user forgets to
|
||||
* close() map, from where this thread is shut down explicitly. Dereference map within
|
||||
* a single method, {@link #cleanupSegment()}. The map has a chance to be collected by GC when
|
||||
* this thread is sleeping after cleaning up a segment.
|
||||
* Don't store a strong ref to a map in order to avoid it's leaking, if the user forgets to close() map, from where this thread is shut down
|
||||
* explicitly. Dereference map within a single method, {@link #cleanupSegment()}. The map has a chance to be collected by GC when this thread is
|
||||
* sleeping after cleaning up a segment.
|
||||
*/
|
||||
private final WeakReference<ReplicatedChronicleMap<?, ?, ?>> mapRef;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user