R - The type of the records in the RecordStorepublic class MerkleTreeUpdaterRecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record> extends Object implements com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R>
RecordStoreMutationObserver instance, which updates the provided
MerkleTree when updating the observed RecordStore
In this class we need the Java objects to be converted to Data
in order to guarantee that the same hashcode is generated for the same
payload in every mutation case. Without this conversion and with
InMemoryFormat.OBJECT, for example onUpdateRecord(com.hazelcast.nio.serialization.Data, R, java.lang.Object) passes
a Java object as oldValue and a HeapData as newValue to the
MerkleTree. These two values generate different hash codes even
if they represent the "same" value. These different hash codes lead to
changing the corresponding branch of the Merkle tree even if the record
is updated with the same value, which is seen by a false difference by
the Merkle consistency check.
| Constructor and Description |
|---|
MerkleTreeUpdaterRecordStoreMutationObserver(com.hazelcast.wan.merkletree.MerkleTree merkleTree,
com.hazelcast.spi.serialization.SerializationService serializationService)
Creates a
MerkleTreeUpdaterRecordStoreMutationObserver instance |
| Modifier and Type | Method and Description |
|---|---|
void |
onClear() |
void |
onDestroy(boolean internal) |
void |
onEvictRecord(com.hazelcast.nio.serialization.Data key,
R record) |
void |
onLoadRecord(com.hazelcast.nio.serialization.Data key,
R record) |
void |
onPutRecord(com.hazelcast.nio.serialization.Data key,
R record) |
void |
onRemoveRecord(com.hazelcast.nio.serialization.Data key,
R record) |
void |
onReplicationPutRecord(com.hazelcast.nio.serialization.Data key,
R record) |
void |
onReset() |
void |
onUpdateRecord(com.hazelcast.nio.serialization.Data key,
R record,
Object newValue) |
public MerkleTreeUpdaterRecordStoreMutationObserver(com.hazelcast.wan.merkletree.MerkleTree merkleTree,
com.hazelcast.spi.serialization.SerializationService serializationService)
MerkleTreeUpdaterRecordStoreMutationObserver instancemerkleTree - The Merkle tree to updateserializationService - The serialization service used for
Data conversionpublic void onClear()
onClear in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onPutRecord(com.hazelcast.nio.serialization.Data key,
R record)
onPutRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onReplicationPutRecord(com.hazelcast.nio.serialization.Data key,
R record)
onReplicationPutRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onUpdateRecord(com.hazelcast.nio.serialization.Data key,
R record,
Object newValue)
onUpdateRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onRemoveRecord(com.hazelcast.nio.serialization.Data key,
R record)
onRemoveRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onEvictRecord(com.hazelcast.nio.serialization.Data key,
R record)
onEvictRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onLoadRecord(com.hazelcast.nio.serialization.Data key,
R record)
onLoadRecord in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onDestroy(boolean internal)
onDestroy in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>public void onReset()
onReset in interface com.hazelcast.map.impl.recordstore.RecordStoreMutationObserver<R extends com.hazelcast.map.impl.record.Record>Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.