public class EntryRemovingProcessor extends AbstractEntryProcessor implements IdentifiedDataSerializable
Modifier and Type | Field and Description |
---|---|
static EntryRemovingProcessor |
ENTRY_REMOVING_PROCESSOR |
Constructor and Description |
---|
EntryRemovingProcessor() |
Modifier and Type | Method and Description |
---|---|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
process(Map.Entry entry)
Process the entry without worrying about concurrency.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
getBackupProcessor
public static final EntryRemovingProcessor ENTRY_REMOVING_PROCESSOR
public Object process(Map.Entry entry)
EntryProcessor
Note that to modify an entry by using an EntryProcessor you should explicitly call
setValue()
method of Map.Entry
,
for example:
@Override public Object process(Map.Entry entry) { Value value = entry.getValue(); // process and modify value // ... entry.setValue(value); return result; }otherwise the
EntryProcessor
does not guarantee to modify the entry.
The entry's value will be null
, if the entry for the key doesn't exist. You
can create new mapping by setting a non-null value or remove existing mapping
entry by setting the value to null.
process
in interface EntryProcessor
entry
- entry to be processedEntryProcessor
, such as
IMap.executeOnKey()
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.