From b51207186af27c1f868f38475ce6120398ba777e Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Fri, 29 May 2020 18:22:13 +0100 Subject: [PATCH] changed to MapClosable --- .../openhft/chronicle/hash/HashSegmentContext.java | 12 +++++------- .../map/OldDeletedEntriesCleanupThread.java | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/hash/HashSegmentContext.java b/src/main/java/net/openhft/chronicle/hash/HashSegmentContext.java index 8f135e02e..425c32d92 100644 --- a/src/main/java/net/openhft/chronicle/hash/HashSegmentContext.java +++ b/src/main/java/net/openhft/chronicle/hash/HashSegmentContext.java @@ -16,7 +16,7 @@ package net.openhft.chronicle.hash; -import net.openhft.chronicle.core.io.DefaultCloseable; +import net.openhft.chronicle.map.MapClosable; import java.util.function.Consumer; import java.util.function.Predicate; @@ -28,7 +28,7 @@ import java.util.function.Predicate; * @param the entry type * @see ChronicleHash#segmentContext(int) */ -public interface HashSegmentContext> extends HashContext, DefaultCloseable { +public interface HashSegmentContext> extends HashContext, MapClosable { /** * Performs the given action for each present entry in this segment until all entries have been processed or the action throws an {@code @@ -39,16 +39,14 @@ public interface HashSegmentContext> extends HashConte void forEachSegmentEntry(Consumer action); /** - * Checks the given predicate on each present entry in this segment until all entries - * have been processed or the predicate returns {@code false} for some entry, or throws - * an {@code Exception}. Exceptions thrown by the predicate are relayed to the caller. + * Checks the given predicate on each present entry in this segment until all entries have been processed or the predicate returns {@code + * false} for some entry, or throws an {@code Exception}. Exceptions thrown by the predicate are relayed to the caller. *

*

If this segment is empty (i. e. {@link #size()} call returns 0), this method returns * {@code true} immediately. * * @param predicate the predicate to be checked for each entry in this segment - * @return {@code true} if the predicate returned {@code true} for all checked entries, - * {@code false} if it returned {@code false} for some entry + * @return {@code true} if the predicate returned {@code true} for all checked entries, {@code false} if it returned {@code false} for some entry */ boolean forEachSegmentEntryWhile(Predicate predicate); diff --git a/src/main/java/net/openhft/chronicle/map/OldDeletedEntriesCleanupThread.java b/src/main/java/net/openhft/chronicle/map/OldDeletedEntriesCleanupThread.java index 4fbd8ef3a..b6dbbcebf 100644 --- a/src/main/java/net/openhft/chronicle/map/OldDeletedEntriesCleanupThread.java +++ b/src/main/java/net/openhft/chronicle/map/OldDeletedEntriesCleanupThread.java @@ -16,7 +16,6 @@ package net.openhft.chronicle.map; -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,7 +33,7 @@ import static net.openhft.chronicle.hash.replication.TimeProvider.currentTime; import static net.openhft.chronicle.hash.replication.TimeProvider.systemTimeIntervalBetween; class OldDeletedEntriesCleanupThread extends Thread - implements DefaultCloseable, Predicate { + implements MapClosable, Predicate { private static final Logger LOG = LoggerFactory.getLogger(OldDeletedEntriesCleanupThread.class); /**