com.hazelcast.map.impl.operation
Class MultipleEntryOperation
java.lang.Object
com.hazelcast.spi.Operation
com.hazelcast.spi.AbstractOperation
com.hazelcast.spi.impl.AbstractNamedOperation
com.hazelcast.map.impl.operation.AbstractMapOperation
com.hazelcast.map.impl.operation.MultipleEntryOperation
- All Implemented Interfaces:
- DataSerializable, BackupAwareOperation, RemotePropagatable<Operation>, PartitionAwareOperation
public class MultipleEntryOperation
- extends AbstractMapOperation
- implements BackupAwareOperation
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 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.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 |
responses
protected MapEntrySet responses
entryProcessor
protected EntryProcessor entryProcessor
backupProcessor
protected EntryBackupProcessor backupProcessor
recordStore
protected transient RecordStore recordStore
MultipleEntryOperation
public MultipleEntryOperation()
MultipleEntryOperation
public MultipleEntryOperation(String name,
Set<Data> keys,
EntryProcessor entryProcessor)
innerBeforeRun
public void innerBeforeRun()
run
public void run()
throws Exception
- Specified by:
run
in class Operation
- Throws:
Exception
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
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.
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
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.