Package org.redisson.mapreduce
Class RedissonMapReduce<KIn,VIn,KOut,VOut>
- java.lang.Object
-
- org.redisson.mapreduce.RedissonMapReduce<KIn,VIn,KOut,VOut>
-
- Type Parameters:
KIn- input key typeVIn- input value typeKOut- output key typeVOut- output value type
- All Implemented Interfaces:
RMapReduce<KIn,VIn,KOut,VOut>,RMapReduceExecutor<VIn,KOut,VOut>
public class RedissonMapReduce<KIn,VIn,KOut,VOut> extends Object implements RMapReduce<KIn,VIn,KOut,VOut>
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description RedissonMapReduce(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 definedcollatorRMapReduce<KIn,VIn,KOut,VOut>mapper(RMapper<KIn,VIn,KOut,VOut> mapper)Setup Mapper objectRMapReduce<KIn,VIn,KOut,VOut>reducer(RReducer<KOut,VOut> reducer)Setup Reducer objectRMapReduce<KIn,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
-
RedissonMapReduce
public RedissonMapReduce(RObject object, RedissonClient redisson, CommandAsyncExecutor commandExecutor)
-
-
Method Detail
-
timeout
public RMapReduce<KIn,VIn,KOut,VOut> timeout(long timeout, TimeUnit unit)
Description copied from interface:RMapReduceDefines timeout for MapReduce process.0means infinity timeout.
-
mapper
public RMapReduce<KIn,VIn,KOut,VOut> mapper(RMapper<KIn,VIn,KOut,VOut> mapper)
Description copied from interface:RMapReduceSetup Mapper object
-
reducer
public RMapReduce<KIn,VIn,KOut,VOut> reducer(RReducer<KOut,VOut> reducer)
Description copied from interface:RMapReduceSetup Reducer object
-
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
-
-