Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.distexec.mapreduce
Interface MapReduceManager

All Known Implementing Classes:
MapReduceManagerImpl

public interface MapReduceManager

MapReduceManager is an internal Infinispan component receiving map/reduce invocations arriving from remote Infinispan nodes.

This interface should never be implemented by clients.

Since:
5.2
Author:
Vladimir Blagojevic

Method Summary
 ExecutorService getExecutorService()
          ExecutorService provided for local task execution
<KIn,VIn,KOut,VOut>
Set<KOut>
mapAndCombineForDistributedReduction(MapCombineCommand<KIn,VIn,KOut,VOut> mcc)
          Invoked when MapCombineCommand arrives to a target Infinispan node and returns set of intermediate keys that needs to be reduced.
<KIn,VIn,KOut,VOut>
Map<KOut,List<VOut>>
mapAndCombineForLocalReduction(MapCombineCommand<KIn,VIn,KOut,VOut> mcc)
          Invoked when MapCombineCommand arrives to a target Infinispan node and returns map of resulting values that need to be reduced.
<T> Map<Address,List<T>>
mapKeysToNodes(DistributionManager dm, String taskId, Collection<T> keysToMap, boolean useIntermediateCompositeKey)
          Maps Map/Reduce task intermediate or input keys to nodes on Infinispan cluster
<KOut,VOut>
Map<KOut,VOut>
reduce(ReduceCommand<KOut,VOut> reducer)
          Invoked when ReduceCommand arrives to a target Infinispan node.
 

Method Detail

mapAndCombineForDistributedReduction

<KIn,VIn,KOut,VOut> Set<KOut> mapAndCombineForDistributedReduction(MapCombineCommand<KIn,VIn,KOut,VOut> mcc)
                                               throws InterruptedException
Invoked when MapCombineCommand arrives to a target Infinispan node and returns set of intermediate keys that needs to be reduced.

Parameters:
mcc - MapCombineCommand sent from MapReduceTask
Returns:
a set of intermediate keys to be reduced distributively
Throws:
InterruptedException

mapAndCombineForLocalReduction

<KIn,VIn,KOut,VOut> Map<KOut,List<VOut>> mapAndCombineForLocalReduction(MapCombineCommand<KIn,VIn,KOut,VOut> mcc)
                                                    throws InterruptedException
Invoked when MapCombineCommand arrives to a target Infinispan node and returns map of resulting values that need to be reduced.

Unlike mapAndCombineForDistributedReduction(MapCombineCommand) implementations should return a map Map> which should be ready for reduction at master Infinispan node

Parameters:
mcc - MapCombineCommand sent from MapReduceTask
Returns:
a map Map> which should be ready for reduction at master Infinispan node
Throws:
InterruptedException

reduce

<KOut,VOut> Map<KOut,VOut> reduce(ReduceCommand<KOut,VOut> reducer)
                      throws InterruptedException
Invoked when ReduceCommand arrives to a target Infinispan node. Implementations should return a map of reduced output keys and values to be returned to invoker of MapReduceTask

Parameters:
reducer - ReduceCommand sent from MapReduceTask
Returns:
map of reduced output keys and values returned to MapReduceTask
Throws:
InterruptedException

mapKeysToNodes

<T> Map<Address,List<T>> mapKeysToNodes(DistributionManager dm,
                                        String taskId,
                                        Collection<T> keysToMap,
                                        boolean useIntermediateCompositeKey)
Maps Map/Reduce task intermediate or input keys to nodes on Infinispan cluster

Parameters:
dm - distribution manager to use for locating keys on hash wheel
taskId - id of the map/reduce task
keysToMap - list of input keys to locate in the cluster
useIntermediateCompositeKey - if true use composite keys for shared intermediate cache
Returns:
map where each key is an Address in the cluster and value are the keys mapped to that Address

getExecutorService

ExecutorService getExecutorService()
ExecutorService provided for local task execution

Returns:
ExecutorService for local tasks

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.