Collects the sub tasks that a map-reduce pipeline job splits its work into, built up by a script's map function. An instance of this class is passed as the subTaskList argument into a JS-exec map-reduce job's map function. The script calls one of the addXxxTask methods once per unit of work it wants processed, and the resulting MapReduceSubTask instances are then queued for the job's reduce phase to work through.
Methods
addTask(String title, Map<String,Serializable> props)
Returns: void
Adds a sub task carrying an arbitrary map of properties, as key value pairs, for the reduce phase to process.
| Parameter | Description |
|---|---|
title | a human-readable title identifying this sub task |
props | the properties this sub task carries through to the reduce phase |
addSinglePropertyTask(String title, String propName, Serializable propValue)
Returns: void
Adds a sub task carrying a single named property for the reduce phase to process.
| Parameter | Description |
|---|---|
title | a human-readable title identifying this sub task |
propName | the name of the single property carried by this sub task |
propValue | the value of the single property carried by this sub task |
addRangeTask(String title, long start, long finish)
Returns: void
Adds a sub task carrying a numeric range, stored as "start" and "finish" properties, for the reduce phase to process - for example a batch covering IDs 0-99, then a second sub task covering 100-199.
| Parameter | Description |
|---|---|
title | a human-readable title identifying this sub task |
start | the inclusive start of the range this sub task covers |
finish | the inclusive end of the range this sub task covers |
addIdsListTask(String title, ArrayList<Serializable> IDs)
Returns: void
Adds a sub task carrying a specific list of IDs, stored as a "listOfIds" property, for the reduce phase to process as a single batch.
| Parameter | Description |
|---|---|
title | a human-readable title identifying this sub task |
IDs | the list of IDs this sub task should process |
size()
Returns: int
The number of sub tasks added to this list so far.