When does MapReduce.completed() run


#1

For a given type that mixes in MapReduce and override the method completed(), do I need to create a reduce() function in order for the completed function to run. If my type was built without a reduce() would the completed() run or not?

For example:
1 - Current implementation)
type TypeA mixes MapReduce< TypeB, string, int, int> {
map: ~ js server
completed: ~ js server
}

2 - Possible fix with reduce)
type TypeA mixes MapReduce< TypeB, string, int, int> {
map: ~ js server
reduce: ~ js server
completed: ~ js server
}

Based on the definition provided in the MapReduce documentation for the completed() function
" function the framework will call after all map and reduce steps have completed ", I am unsure if the missing reduce method would cause this to not run as it seems.


#2

No need for reduce. If there are no reduce steps, then all of them are complete so it will be called.


#3

Thank-you for the clarification :+1:


#4