mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Require update lock level for checking entry checksum
This commit is contained in:
@@ -32,6 +32,13 @@ public interface ChecksumEntry {
|
||||
* only when value bytes was updated directly, for example though flyweight implementation of
|
||||
* a <a href="https://github.com/OpenHFT/Chronicle-Values#value-interface-specification">value
|
||||
* interface</a>.
|
||||
*
|
||||
* @throws UnsupportedOperationException if checksums are not stored in the containing Chronicle
|
||||
* Hash
|
||||
* @throws RuntimeException if the context of this entry is locked improperly, e. g. on the
|
||||
* {@linkplain HashQueryContext#readLock() read} level, that is not upgradable to the
|
||||
* {@linkplain HashQueryContext#updateLock() update} level. Calling {@code updateChecksum()}
|
||||
* method is enabled when at least update lock is held.
|
||||
*/
|
||||
void updateChecksum();
|
||||
|
||||
@@ -39,6 +46,12 @@ public interface ChecksumEntry {
|
||||
* Computes checksum from the entry bytes and checks whether it is equal to the stored checksum.
|
||||
*
|
||||
* @return {@code true} if stored checksum equals to checksum computed from the entry bytes
|
||||
* @throws UnsupportedOperationException if checksums are not stored in the containing Chronicle
|
||||
* Hash
|
||||
* @throws RuntimeException if the context of this entry is locked improperly, e. g. on the
|
||||
* {@linkplain HashQueryContext#readLock() read} level, that is not upgradable to the
|
||||
* {@linkplain HashQueryContext#updateLock() update} level. Calling {@code checkSum()} method is
|
||||
* enabled when at least update lock is held.
|
||||
*/
|
||||
boolean checkSum();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user