diff --git a/docs/archived/README.md b/docs/archived/README.md index 21f40bf52..c631d9347 100644 --- a/docs/archived/README.md +++ b/docs/archived/README.md @@ -414,7 +414,7 @@ ChronicleMap cityPostalCodes = ChronicleMap If the Chronicle Map is configured to store entry checksums along with entries, recovery procedure checks for each entry that the checksums is correct, otherwise it assumes the entry is corrupted and -deletes it from the Chronicle Map. If checksums are to stored, recovery procedure cannot guarantee +deletes it from the Chronicle Map. If checksums are not stored, recovery procedure cannot guarantee correctness of entry data. See [Entry checksums](#entry-checksums) section for more information. #### Key and Value Types diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index 48744360e..02cc5381e 100644 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -48,8 +48,6 @@ import net.openhft.chronicle.wire.TextWire; import net.openhft.chronicle.wire.Wire; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.*; import java.lang.reflect.InvocationTargetException; @@ -1833,6 +1831,12 @@ public final class ChronicleMapBuilder implements final boolean recover, final boolean overrideBuilderConfig, @Nullable final ChronicleHashCorruption.Listener corruptionListener) throws IOException { + + if (recover) { + Jvm.warn().on(ChronicleMapBuilder.class, "Recovery operation needs exclusive access to the ChronicleMap or else the result is unspecified including the risk of loosing and/or corrupting partial or all data."); + Jvm.warn().on(ChronicleMapBuilder.class, "Do not use recovery as a standard way of opening a ChronicleMap."); + } + final ChronicleHashCorruptionImpl corruption = recover ? new ChronicleHashCorruptionImpl() : null; try { int headerSize = waitUntilReady(raf, file, recover);