Package org.redisson.mapreduce
Class RedissonCollectionMapReduce<VIn,KOut,VOut>
- java.lang.Object
-
- org.redisson.mapreduce.RedissonCollectionMapReduce<VIn,KOut,VOut>
-
- Type Parameters:
VIn- input value typeKOut- output key typeVOut- output value type
- All Implemented Interfaces:
RCollectionMapReduce<VIn,KOut,VOut>,RMapReduceExecutor<VIn,KOut,VOut>
public class RedissonCollectionMapReduce<VIn,KOut,VOut> extends Object implements RCollectionMapReduce<VIn,KOut,VOut>
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description RedissonCollectionMapReduce(RObject object, RedissonClient redisson, CommandAsyncExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheck(Object task)protected Callable<Object>createTask(String resultMapName, RCollator<KOut,VOut,Object> collator)Map<KOut,VOut>execute()Executes MapReduce process across Redisson Nodesvoidexecute(String resultMapName)Executes MapReduce process across Redisson Nodes and stores result in map withresultMapName<R> Rexecute(RCollator<KOut,VOut,R> collator)Executes MapReduce process across Redisson Nodes and collides result using definedcollatorRFuture<Map<KOut,VOut>>executeAsync()Executes MapReduce process across Redisson Nodes in asynchronous modeRFuture<Void>executeAsync(String resultMapName)Executes MapReduce process across Redisson Nodes in asynchronous mode and stores result in map withresultMapName<R> RFuture<R>executeAsync(RCollator<KOut,VOut,R> collator)Executes MapReduce process across Redisson Nodes in asynchronous mode and collides result using definedcollatorRCollectionMapReduce<VIn,KOut,VOut>mapper(RCollectionMapper<VIn,KOut,VOut> mapper)Setup Mapper objectRCollectionMapReduce<VIn,KOut,VOut>reducer(RReducer<KOut,VOut> reducer)Setup Reducer objectRCollectionMapReduce<VIn,KOut,VOut>timeout(long timeout, TimeUnit unit)Defines timeout for MapReduce process-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.redisson.api.mapreduce.RMapReduceExecutor
execute, execute, execute, executeAsync, executeAsync, executeAsync
-
-
-
-
Constructor Detail
-
RedissonCollectionMapReduce
public RedissonCollectionMapReduce(RObject object, RedissonClient redisson, CommandAsyncExecutor commandExecutor)
-
-
Method Detail
-
timeout
public RCollectionMapReduce<VIn,KOut,VOut> timeout(long timeout, TimeUnit unit)
Description copied from interface:RCollectionMapReduceDefines timeout for MapReduce process- Specified by:
timeoutin interfaceRCollectionMapReduce<VIn,KOut,VOut>- Parameters:
timeout- for processunit- of timeout- Returns:
- self instance
-
mapper
public RCollectionMapReduce<VIn,KOut,VOut> mapper(RCollectionMapper<VIn,KOut,VOut> mapper)
Description copied from interface:RCollectionMapReduceSetup Mapper object- Specified by:
mapperin interfaceRCollectionMapReduce<VIn,KOut,VOut>- Parameters:
mapper- used during MapReduce- Returns:
- self instance
-
reducer
public RCollectionMapReduce<VIn,KOut,VOut> reducer(RReducer<KOut,VOut> reducer)
Description copied from interface:RCollectionMapReduceSetup Reducer object- Specified by:
reducerin interfaceRCollectionMapReduce<VIn,KOut,VOut>- Parameters:
reducer- used during MapReduce- Returns:
- self instance
-
createTask
protected Callable<Object> createTask(String resultMapName, RCollator<KOut,VOut,Object> collator)
-
check
protected void check(Object task)
-
execute
public Map<KOut,VOut> execute()
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes- Specified by:
executein interfaceRMapReduceExecutor<M,VIn,KOut>- Returns:
- map containing reduced keys and values
-
executeAsync
public RFuture<Map<KOut,VOut>> executeAsync()
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes in asynchronous mode- Specified by:
executeAsyncin interfaceRMapReduceExecutor<M,VIn,KOut>- Returns:
- map containing reduced keys and values
-
execute
public void execute(String resultMapName)
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes and stores result in map withresultMapName- Specified by:
executein interfaceRMapReduceExecutor<M,VIn,KOut>- Parameters:
resultMapName- - destination map name
-
executeAsync
public RFuture<Void> executeAsync(String resultMapName)
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes in asynchronous mode and stores result in map withresultMapName- Specified by:
executeAsyncin interfaceRMapReduceExecutor<M,VIn,KOut>- Parameters:
resultMapName- - destination map name- Returns:
- void
-
execute
public <R> R execute(RCollator<KOut,VOut,R> collator)
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes and collides result using definedcollator- Specified by:
executein interfaceRMapReduceExecutor<M,VIn,KOut>- Type Parameters:
R- result type- Parameters:
collator- applied to result- Returns:
- collated result
-
executeAsync
public <R> RFuture<R> executeAsync(RCollator<KOut,VOut,R> collator)
Description copied from interface:RMapReduceExecutorExecutes MapReduce process across Redisson Nodes in asynchronous mode and collides result using definedcollator- Specified by:
executeAsyncin interfaceRMapReduceExecutor<M,VIn,KOut>- Type Parameters:
R- result type- Parameters:
collator- applied to result- Returns:
- collated result
-
-