|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- Type of key of a Map.Entry
V
- Type of value of a Map.Entry
public interface EntryProcessor<K,V>
An EntryProcessor passes you a Map.Entry
. At the time you receive it
the entry is locked and not released until the EntryProcessor completes.
This obviates the need to explicitly lock as would be required with a ExecutorService
.
InMemoryFormat.OBJECT
then there is no de-serialization or serialization
cost.
EntryProcessors execute on the partition thread in a member. Multiple operations on the same partition are queued.
While executing partition migrations are not allowed. Any migrations are queued on the partition thread.
An EntryProcessor may not be re-entrant i.e. it may not access the same Map
. Limitation: you can only access
data on the same partition.
Note that to modify an entry by using EntryProcessors you should explicitly call
Map.Entry.setValue(V)
method of Map.Entry
such as:
Override
public Object process(Map.Entry entry) {
Value value = entry.getValue();
// process and modify value
// ...
entry.setValue(value);
return result;
}
otherwise EntryProcessor does not guarantee to modify the entry.
AbstractEntryProcessor
Method Summary | |
---|---|
EntryBackupProcessor<K,V> |
getBackupProcessor()
Get the entry processor to be applied to backup entries. |
Object |
process(Map.Entry<K,V> entry)
Process the entry without worrying about concurrency. |
Method Detail |
---|
Object process(Map.Entry<K,V> entry)
Map.Entry.setValue(V)
method of Map.Entry
such as:
Override
public Object process(Map.Entry entry) {
Value value = entry.getValue();
// process and modify value
// ...
entry.setValue(value);
return result;
}
otherwise EntryProcessor does not guarantee to modify the entry.
entry
- entry to be processed
EntryBackupProcessor<K,V> getBackupProcessor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |