com.hazelcast.mapreduce.impl
Class AbstractJob.MappingJobImpl<EntryKey,Key,Value>

java.lang.Object
  extended by com.hazelcast.mapreduce.impl.AbstractJob.MappingJobImpl<EntryKey,Key,Value>
Type Parameters:
EntryKey - type of the original base key
Key - type of the key at that processing state
Value - type of the value at that processing state
All Implemented Interfaces:
MappingJob<EntryKey,Key,Value>
Enclosing class:
AbstractJob<KeyIn,ValueIn>

protected class AbstractJob.MappingJobImpl<EntryKey,Key,Value>
extends Object
implements MappingJob<EntryKey,Key,Value>

This class is just used to comply to the public DSL style API


Constructor Summary
protected AbstractJob.MappingJobImpl()
           
 
Method Summary
 MappingJob<EntryKey,Key,Value> chunkSize(int chunkSize)
          Defines the number of elements per chunk.
<ValueOut> ReducingJob<EntryKey,Key,ValueOut>
combiner(CombinerFactory<Key,Value,ValueOut> combinerFactory)
          Defines the CombinerFactory for this task.
 MappingJob<EntryKey,Key,Value> keyPredicate(KeyPredicate<EntryKey> predicate)
          Defines the KeyPredicate implementation to preselect keys the MapReduce task will be executed on.
 MappingJob<EntryKey,Key,Value> onKeys(EntryKey... keys)
          Defines keys to execute the mapper and a possibly defined reducer against.
 MappingJob<EntryKey,Key,Value> onKeys(Iterable<EntryKey> keys)
          Defines keys to execute the mapper and a possibly defined reducer against.
<ValueOut> ReducingSubmittableJob<EntryKey,Key,ValueOut>
reducer(ReducerFactory<Key,Value,ValueOut> reducerFactory)
          Defines the ReducerFactory for this task.
 JobCompletableFuture<Map<Key,List<Value>>> submit()
          Submits the task to Hazelcast and executes the defined mapper and reducer on all cluster nodes
<ValueOut> JobCompletableFuture<ValueOut>
submit(Collator<Map.Entry<Key,List<Value>>,ValueOut> collator)
          Submits the task to Hazelcast and executes the defined mapper and reducer on all cluster nodes and executes the collator before returning the final result.
 MappingJob<EntryKey,Key,Value> topologyChangedStrategy(TopologyChangedStrategy topologyChangedStrategy)
          Defines the strategy to handle topology changes while executing the map reduce job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJob.MappingJobImpl

protected AbstractJob.MappingJobImpl()
Method Detail

onKeys

public MappingJob<EntryKey,Key,Value> onKeys(Iterable<EntryKey> keys)
Description copied from interface: MappingJob
Defines keys to execute the mapper and a possibly defined reducer against. If keys are known before submitting the task setting them can improve execution speed.

Specified by:
onKeys in interface MappingJob<EntryKey,Key,Value>
Parameters:
keys - keys to be executed against
Returns:
instance of this Job with generics changed on usage

onKeys

public MappingJob<EntryKey,Key,Value> onKeys(EntryKey... keys)
Description copied from interface: MappingJob
Defines keys to execute the mapper and a possibly defined reducer against. If keys are known before submitting the task setting them can improve execution speed.

Specified by:
onKeys in interface MappingJob<EntryKey,Key,Value>
Parameters:
keys - keys to be executed against
Returns:
instance of this Job with generics changed on usage

keyPredicate

public MappingJob<EntryKey,Key,Value> keyPredicate(KeyPredicate<EntryKey> predicate)
Description copied from interface: MappingJob
Defines the KeyPredicate implementation to preselect keys the MapReduce task will be executed on. Preselecting keys can speed up the job massively.
This method can be used in conjunction with MappingJob.onKeys(Iterable) or MappingJob.onKeys(Object...) to define a range of known and evaluated keys.

Specified by:
keyPredicate in interface MappingJob<EntryKey,Key,Value>
Parameters:
predicate - predicate implementation to be used to evaluate keys
Returns:
instance of this Job with generics changed on usage

chunkSize

public MappingJob<EntryKey,Key,Value> chunkSize(int chunkSize)
Description copied from interface: MappingJob
Defines the number of elements per chunk. Whenever the chunk size is reached and a ReducerFactory is defined the chunk will be send to the nodes that is responsible for the emitted keys.
Please note, that chunks are deactivated when no ReducerFactory is defined

Specified by:
chunkSize in interface MappingJob<EntryKey,Key,Value>
Parameters:
chunkSize - the number of elements per chunk
Returns:
instance of this Job with generics changed on usage

topologyChangedStrategy

public MappingJob<EntryKey,Key,Value> topologyChangedStrategy(TopologyChangedStrategy topologyChangedStrategy)
Description copied from interface: MappingJob
Defines the strategy to handle topology changes while executing the map reduce job. For further information see TopologyChangedStrategy.

Specified by:
topologyChangedStrategy in interface MappingJob<EntryKey,Key,Value>
Parameters:
topologyChangedStrategy - strategy to use
Returns:
instance of this Job with generics changed on usage

combiner

public <ValueOut> ReducingJob<EntryKey,Key,ValueOut> combiner(CombinerFactory<Key,Value,ValueOut> combinerFactory)
Description copied from interface: MappingJob
Defines the CombinerFactory for this task. This method is not idempotent and is callable only one time. Further calls result in an IllegalStateException to be thrown telling you to not change the internal state.

Specified by:
combiner in interface MappingJob<EntryKey,Key,Value>
Type Parameters:
ValueOut - type of the combined value
Parameters:
combinerFactory - CombinerFactory to build Combiner
Returns:
instance of this Job with generics changed on usage

reducer

public <ValueOut> ReducingSubmittableJob<EntryKey,Key,ValueOut> reducer(ReducerFactory<Key,Value,ValueOut> reducerFactory)
Description copied from interface: MappingJob
Defines the ReducerFactory for this task. This method is not idempotent and is callable only one time. Further calls result in an IllegalStateException to be thrown telling you to not change the internal state.

Specified by:
reducer in interface MappingJob<EntryKey,Key,Value>
Type Parameters:
ValueOut - type of the reduced value
Parameters:
reducerFactory - ReducerFactory to build Reducers
Returns:
instance of this Job with generics changed on usage

submit

public JobCompletableFuture<Map<Key,List<Value>>> submit()
Description copied from interface: MappingJob
Submits the task to Hazelcast and executes the defined mapper and reducer on all cluster nodes

Specified by:
submit in interface MappingJob<EntryKey,Key,Value>
Returns:
JobCompletableFuture to wait for mapped and possibly reduced result

submit

public <ValueOut> JobCompletableFuture<ValueOut> submit(Collator<Map.Entry<Key,List<Value>>,ValueOut> collator)
Description copied from interface: MappingJob
Submits the task to Hazelcast and executes the defined mapper and reducer on all cluster nodes and executes the collator before returning the final result.

Specified by:
submit in interface MappingJob<EntryKey,Key,Value>
Type Parameters:
ValueOut - type of the collated value
Parameters:
collator - collator to use after map and reduce
Returns:
JobCompletableFuture to wait for mapped and possibly reduced result


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.