K
- the key type.V
- the value type.P
- the param holder type.R
- the result type.public interface CacheEntryReduceHandler<K,V,P,R>
Cache.invoke(String, Duration)
call.Modifier and Type | Method and Description |
---|---|
R |
accumulatorFactory()
Generate a thread local accumulator for the final result.
|
R |
deserializeResult(byte[] value)
Deserialize a result value from binary data.
|
R |
map(K key,
R accumulator,
OperationContext<K,V,P> ctx)
Map a key into the thread-local accumulator and return the accumulated result.
|
R |
reduce(R result1,
R result2)
Reduce two results into a single result.
|
byte[] |
serializeResult(R value)
Serialize a result value into binary data.
|
R accumulatorFactory()
R
R map(K key, R accumulator, OperationContext<K,V,P> ctx)
key
- the key.accumulator
- the thread-local result accumulator.ctx
- the OperationContext
R reduce(R result1, R result2)
Reduce two results into a single result.
The infrastructure will reduce the thread-local results into one host-local result that will be reduced against other hosts' results.
result1
- one result.result2
- other result.R deserializeResult(byte[] value)
serializeResult(Object)
.value
- the binary representation of a result.R
.byte[] serializeResult(R value)
value
- the result object.R
.