diff --git a/src/main/java/net/openhft/chronicle/hash/ChronicleHashBuilder.java b/src/main/java/net/openhft/chronicle/hash/ChronicleHashBuilder.java index 13ddf9980..737863e26 100755 --- a/src/main/java/net/openhft/chronicle/hash/ChronicleHashBuilder.java +++ b/src/main/java/net/openhft/chronicle/hash/ChronicleHashBuilder.java @@ -624,6 +624,7 @@ public interface ChronicleHashBuilder, * @see #createOrRecoverPersistedTo(File, boolean) * @see #recoverPersistedTo(File, boolean) */ + @Beta H createOrRecoverPersistedTo( File file, boolean sameLibraryVersion, ChronicleHashCorruption.Listener corruptionListener) throws IOException; @@ -739,6 +740,7 @@ public interface ChronicleHashBuilder, * @see #createOrRecoverPersistedTo(File, boolean, ChronicleHashCorruption.Listener) * @see #createPersistedTo(File) */ + @Beta H recoverPersistedTo( File file, boolean sameBuilderConfigAndLibraryVersion, ChronicleHashCorruption.Listener corruptionListener) throws IOException; diff --git a/src/main/java/net/openhft/chronicle/hash/ChronicleHashCorruption.java b/src/main/java/net/openhft/chronicle/hash/ChronicleHashCorruption.java index 524783e83..46ff75ee5 100644 --- a/src/main/java/net/openhft/chronicle/hash/ChronicleHashCorruption.java +++ b/src/main/java/net/openhft/chronicle/hash/ChronicleHashCorruption.java @@ -38,9 +38,13 @@ import java.io.File; * used outside of the {@link Listener#onCorruption(ChronicleHashCorruption)} method body, because * {@code ChronicleHashCorruption} objects could be reused during the recovery procedure. * + *

During a recovery procedure, {@link Listener#onCorruption(ChronicleHashCorruption)} might + * be called concurrently from multiple threads. If the implementation of this method calls some + * methods on some objects, that are not safe for concurrent use from multiple threads, the + * implementation must care about synchronization itself. * - * @see ChronicleHashBuilder#recoverPersistedTo(File, boolean, Listener) - * @see ChronicleHashBuilder#createOrRecoverPersistedTo(File, boolean, Listener) + * @see ChronicleHashBuilder#recoverPersistedTo(File, boolean, ChronicleHashCorruption.Listener) + * @see ChronicleHashBuilder#createOrRecoverPersistedTo(File, boolean, ChronicleHashCorruption.Listener) */ @Beta public interface ChronicleHashCorruption { @@ -73,9 +77,14 @@ public interface ChronicleHashCorruption { @Beta interface Listener { /** - * Called, when recovery + * Called when recovery * procedure encounters a corruption of a persisted Chronicle Map. * + *

During a recovery procedure, this method might be called concurrently from multiple + * threads. If the implementation of this method calls some methods on some objects, + * that are not safe for concurrent use from multiple threads, the implementation must + * care about synchronization itself. + * * @param corruption the corruption object, must not be saved and used outside the body of * the {@code #onCorruption()} method, because during the recovery * procedure, the same corruption object could be reused. diff --git a/src/main/java/net/openhft/chronicle/hash/serialization/SizedReader.java b/src/main/java/net/openhft/chronicle/hash/serialization/SizedReader.java index 36707d505..82e7f8116 100644 --- a/src/main/java/net/openhft/chronicle/hash/serialization/SizedReader.java +++ b/src/main/java/net/openhft/chronicle/hash/serialization/SizedReader.java @@ -53,7 +53,7 @@ public interface SizedReader extends Marshallable { * given {@code using} object, i. e. to read the deserialized data into the given object. If it * is possible, this objects then returned from this method. If it is impossible for any reason, * a new object should be created and returned. The given {@code using} object could be {@code - * null}, in this case this method, of cause, should create a new object. + * null}, in this case read() should always create a new object. * *

This method should increment the position in the given {@code Bytes} by the given {@code * size}.