public abstract class AbstractEntryProcessor<K,V> extends Object implements EntryProcessor<K,V>
EntryProcessor
that already has implemented the getBackupProcessor()
. In a most cases you
want the same logic to be executed on the primary and on the backup. This implementation has this behavior.
Note that there is a possibility which an AbstractEntryProcessor
can see that a key exists
but its backup processor may not find it due to an unsent backup of a previous operation (e.g. a previous put).
In those situations, Hazelcast internally/eventually will sync those owner and backup partitions so you will not lose any data.
Because AbstractEntryProcessor uses the same processor in both owner and backup,
you should take this case into account when implementing EntryProcessor.process(java.util.Map.Entry)
.EntryProcessor
,
EntryBackupProcessor
,
Serialized FormConstructor and Description |
---|
AbstractEntryProcessor()
Creates an AbstractEntryProcessor that applies the
EntryProcessor.process(java.util.Map.Entry) to primary and backups. |
AbstractEntryProcessor(boolean applyOnBackup)
Creates an AbstractEntryProcessor.
|
Modifier and Type | Method and Description |
---|---|
EntryBackupProcessor<K,V> |
getBackupProcessor()
Get the entry processor to be applied to backup entries.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
process
public AbstractEntryProcessor()
EntryProcessor.process(java.util.Map.Entry)
to primary and backups.public AbstractEntryProcessor(boolean applyOnBackup)
applyOnBackup
- true if the EntryProcessor.process(java.util.Map.Entry)
should also be applied on the backup.public final EntryBackupProcessor<K,V> getBackupProcessor()
EntryProcessor
null
can be returned to indicate that no backups should be made.getBackupProcessor
in interface EntryProcessor<K,V>
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.