com.hazelcast.map

## Class AbstractEntryProcessor<K,V>

- java.lang.Object
- - com.hazelcast.map.AbstractEntryProcessor<K,V>

- Type Parameters:
    `K` - Type of key of a `Map.Entry`
    `V` - Type of value of a `Map.Entry`
  All Implemented Interfaces:
    EntryProcessor<K,V>, Serializable

      public abstract class AbstractEntryProcessor<K,V>
      extends Object
      implements EntryProcessor<K,V>

  An abstract `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)`.
  See Also:
    `EntryProcessor`, `EntryBackupProcessor`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor 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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EntryBackupProcessor<K,V>` | `getBackupProcessor()` Get the entry processor to be applied to backup entries.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.map.EntryProcessor

      `process`

- - ### Constructor Detail

    - #### AbstractEntryProcessor

          public AbstractEntryProcessor()

      Creates an AbstractEntryProcessor that applies the `EntryProcessor.process(java.util.Map.Entry)` to primary and backups.

    - #### AbstractEntryProcessor

          public AbstractEntryProcessor(boolean applyOnBackup)

      Creates an AbstractEntryProcessor.
      Parameters:
        `applyOnBackup` - true if the `EntryProcessor.process(java.util.Map.Entry)` should also be applied on the backup.

  - ### Method Detail

    - #### getBackupProcessor

          public final EntryBackupProcessor<K,V> getBackupProcessor()

      Description copied from interface: `EntryProcessor`
      Get the entry processor to be applied to backup entries. In case of a readonly execution, `null` can be returned to indicate that no backups should be made.
      Specified by:
        `getBackupProcessor` in interface `EntryProcessor<K,V>`
      Returns:
        the back up processor

Copyright © 2018. All rights reserved.