com.hazelcast.map.impl.operation
Class PartitionWideEntryOperation

java.lang.Object
  extended by com.hazelcast.spi.Operation
      extended by com.hazelcast.spi.AbstractOperation
          extended by com.hazelcast.spi.impl.AbstractNamedOperation
              extended by com.hazelcast.map.impl.operation.AbstractMapOperation
                  extended by com.hazelcast.map.impl.operation.PartitionWideEntryOperation
All Implemented Interfaces:
DataSerializable, BackupAwareOperation, RemotePropagatable<Operation>, PartitionAwareOperation
Direct Known Subclasses:
PartitionWideEntryWithPredicateOperation

public class PartitionWideEntryOperation
extends AbstractMapOperation
implements BackupAwareOperation

GOTCHA : This operation does NOT load missing keys from map-store for now.


Field Summary
protected  EntryBackupProcessor backupProcessor
           
protected  EntryProcessor entryProcessor
           
protected  RecordStore recordStore
           
protected  MapEntrySet responses
           
 
Fields inherited from class com.hazelcast.map.impl.operation.AbstractMapOperation
mapContainer, mapService
 
Fields inherited from class com.hazelcast.spi.impl.AbstractNamedOperation
name
 
Constructor Summary
PartitionWideEntryOperation()
           
PartitionWideEntryOperation(String name, EntryProcessor entryProcessor)
           
 
Method Summary
protected  void addToResponses(Data key, Data response)
           
protected  Map.Entry createMapEntry(Object key, Object value)
           
protected  void doPostOps(Data key, Object oldValue, Map.Entry entry)
           
protected  boolean entryAddedOrUpdated(Map.Entry entry, Data key, Object oldValue, long now)
           
protected  boolean entryAddedOrUpdatedBackup(Map.Entry entry, Data key)
           
protected  boolean entryRemoved(Map.Entry entry, Data key, Object oldValue, long now)
           
protected  boolean entryRemovedBackup(Map.Entry entry, Data key)
           
protected  void evict(boolean backup)
           
 int getAsyncBackupCount()
          The asynchronous backup count.
 Operation getBackupOperation()
          Creates the BackupOperation responsible for making the backup.
protected  long getLatencyFrom(long begin)
           
protected  LocalMapStatsImpl getLocalMapStats()
           
protected  MapEventPublisher getMapEventPublisher()
           
protected  MapServiceContext getMapServiceContext()
           
protected  long getNow()
           
protected  Predicate getPredicate()
           
protected  RecordStore getRecordStore()
           
 Object getResponse()
           
 int getSyncBackupCount()
          The synchronous backup count.
protected  Object getValueFor(Data dataKey, long now)
           
protected  boolean hasRegisteredListenerForThisMap()
           
 void innerBeforeRun()
           
protected  void invalidateNearCaches(Data key)
           
protected  boolean keyNotOwnedByThisPartition(Data key)
           
protected  boolean noOp(Map.Entry entry, Object oldValue)
          Entry has not exist and no add operation has been done.
protected  Object nullifyOldValueIfNecessary(Object oldValue, EntryEventType eventType)
          Nullify old value if in memory format is object and operation is not removal since old and new value in fired event EntryEvent may be same due to the object in memory format.
protected  Data process(Map.Entry entry)
           
protected  void processBackup(Map.Entry entry)
           
protected  Object publishEntryEvent(Data key, Object value, Object oldValue, EntryEventType eventType)
           
protected  void publishWanReplicationEvent(Data key, Object value, EntryEventType eventType)
           
protected  void put(Data key, Object value)
           
protected  void readInternal(ObjectDataInput in)
           
 boolean returnsResponse()
           
 void run()
           
 boolean shouldBackup()
          Checks if a backup needs to be made.
protected  Data toData(Object obj)
           
protected  Object toObject(Object data)
           
 String toString()
           
protected  void writeInternal(ObjectDataOutput out)
           
 
Methods inherited from class com.hazelcast.map.impl.operation.AbstractMapOperation
afterRun, beforeRun
 
Methods inherited from class com.hazelcast.spi.impl.AbstractNamedOperation
getName
 
Methods inherited from class com.hazelcast.spi.Operation
getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getExecutorName, getInvocationTime, getLogger, getNodeEngine, getPartitionId, getReplicaIndex, getResponseHandler, getService, getServiceName, getWaitTimeout, isUrgent, logError, onException, readData, setCallerUuid, setExecutorName, setNodeEngine, setPartitionId, setReplicaIndex, setResponseHandler, setService, setServiceName, setValidateTarget, setWaitTimeout, validatesTarget, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.spi.PartitionAwareOperation
getPartitionId
 

Field Detail

responses

protected MapEntrySet responses

entryProcessor

protected EntryProcessor entryProcessor

backupProcessor

protected EntryBackupProcessor backupProcessor

recordStore

protected transient RecordStore recordStore
Constructor Detail

PartitionWideEntryOperation

public PartitionWideEntryOperation(String name,
                                   EntryProcessor entryProcessor)

PartitionWideEntryOperation

public PartitionWideEntryOperation()
Method Detail

innerBeforeRun

public void innerBeforeRun()

run

public void run()
Specified by:
run in class Operation

returnsResponse

public boolean returnsResponse()
Specified by:
returnsResponse in interface RemotePropagatable<Operation>
Overrides:
returnsResponse in class AbstractMapOperation

getResponse

public Object getResponse()
Overrides:
getResponse in class AbstractOperation

readInternal

protected void readInternal(ObjectDataInput in)
                     throws IOException
Overrides:
readInternal in class AbstractNamedOperation
Throws:
IOException

writeInternal

protected void writeInternal(ObjectDataOutput out)
                      throws IOException
Overrides:
writeInternal in class AbstractNamedOperation
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Operation

shouldBackup

public boolean shouldBackup()
Description copied from interface: BackupAwareOperation
Checks if a backup needs to be made.

If a call has not made any change, e.g. an AtomicLong increment with 0, no backup needs to be made.

Specified by:
shouldBackup in interface BackupAwareOperation
Returns:
true if a backup needs to be made, false otherwise.

getSyncBackupCount

public int getSyncBackupCount()
Description copied from interface: BackupAwareOperation
The synchronous backup count. If no backups need to be made, 0 is returned.

Specified by:
getSyncBackupCount in interface BackupAwareOperation
Returns:
the synchronous backup count.

getAsyncBackupCount

public int getAsyncBackupCount()
Description copied from interface: BackupAwareOperation
The asynchronous backup count. If no asynchronous backups need to be made, 0 is returned.

Specified by:
getAsyncBackupCount in interface BackupAwareOperation
Returns:
the asynchronous backup count.

getBackupOperation

public Operation getBackupOperation()
Description copied from interface: BackupAwareOperation
Creates the BackupOperation responsible for making the backup.

Specified by:
getBackupOperation in interface BackupAwareOperation
Returns:
the created BackupOperation.

getPredicate

protected Predicate getPredicate()

getRecordStore

protected RecordStore getRecordStore()

createMapEntry

protected Map.Entry createMapEntry(Object key,
                                   Object value)

hasRegisteredListenerForThisMap

protected boolean hasRegisteredListenerForThisMap()

nullifyOldValueIfNecessary

protected Object nullifyOldValueIfNecessary(Object oldValue,
                                            EntryEventType eventType)
Nullify old value if in memory format is object and operation is not removal since old and new value in fired event EntryEvent may be same due to the object in memory format.


getMapEventPublisher

protected MapEventPublisher getMapEventPublisher()

getLocalMapStats

protected LocalMapStatsImpl getLocalMapStats()

noOp

protected boolean noOp(Map.Entry entry,
                       Object oldValue)
Entry has not exist and no add operation has been done.


entryRemoved

protected boolean entryRemoved(Map.Entry entry,
                               Data key,
                               Object oldValue,
                               long now)

entryAddedOrUpdated

protected boolean entryAddedOrUpdated(Map.Entry entry,
                                      Data key,
                                      Object oldValue,
                                      long now)

doPostOps

protected void doPostOps(Data key,
                         Object oldValue,
                         Map.Entry entry)

entryRemovedBackup

protected boolean entryRemovedBackup(Map.Entry entry,
                                     Data key)

entryAddedOrUpdatedBackup

protected boolean entryAddedOrUpdatedBackup(Map.Entry entry,
                                            Data key)

put

protected void put(Data key,
                   Object value)

toObject

protected Object toObject(Object data)

toData

protected Data toData(Object obj)

getNow

protected long getNow()

invalidateNearCaches

protected void invalidateNearCaches(Data key)

publishEntryEvent

protected Object publishEntryEvent(Data key,
                                   Object value,
                                   Object oldValue,
                                   EntryEventType eventType)

publishWanReplicationEvent

protected void publishWanReplicationEvent(Data key,
                                          Object value,
                                          EntryEventType eventType)

getMapServiceContext

protected MapServiceContext getMapServiceContext()

getLatencyFrom

protected long getLatencyFrom(long begin)

addToResponses

protected void addToResponses(Data key,
                              Data response)

process

protected Data process(Map.Entry entry)

processBackup

protected void processBackup(Map.Entry entry)

getValueFor

protected Object getValueFor(Data dataKey,
                             long now)

keyNotOwnedByThisPartition

protected boolean keyNotOwnedByThisPartition(Data key)

evict

protected void evict(boolean backup)


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.