Difference between revisions of "Cholera MapReduce Application"
Line 44: | Line 44: | ||
==createCollector== | ==createCollector== | ||
+ | Depending on your approach, you may be able to reuse one of your existing Collectors. Otherwise, implement one to go with your Mapper. | ||
+ | |||
{{Sequential|public static Collector<? extends Number, ?, ? extends Number> createCollector()}} | {{Sequential|public static Collector<? extends Number, ?, ? extends Number> createCollector()}} | ||
Revision as of 17:05, 27 February 2018
Contents
Motivation
Epidemiology is the important study of "why certain people are getting ill."
We get a chance to make sense of the data in a relatively open ended studio.
Background
Imagine you are a physician in 1854 London in the midst of a cholera outbreak. Your theory that contaminated water is the cause meets resistance from the medical establishment which holds that it is spread via the air.
Imagine further that your friend Ada has left you access to computing.
Code To Use
We have made the data from this GIS Analysis available via methods:
Code To Implement
class: | CholeraApp.java | |
methods: | getValueRepresentation createMapper createCollector |
|
package: | mapreduce.apps.cholera.studio | |
source folder: | student/src/main/java |
getValueRepresentation
method: public static CholeraAppValueRepresentation getValueRepresentation()
(sequential implementation only)
createMapper
method: public static Mapper<CholeraDeath, WaterPump, Number> createMapper()
(sequential implementation only)
We have implemented WaterPump as an enum. You can access the enum constants of any enum via its values() method. For example:
for (WaterPump pump : WaterPump.values()) { }
createCollector
Depending on your approach, you may be able to reuse one of your existing Collectors. Otherwise, implement one to go with your Mapper.
method: public static Collector<? extends Number, ?, ? extends Number> createCollector()
(sequential implementation only)
Testing Your Solution
Visualization
Original Map Drawn By John Snow:
Our Visualization App:
class: | CholeraOutbreakVisualizationApp.java | VIZ |
package: | mapreduce.apps.cholera.viz | |
source folder: | student/src//java |
Correctness
class: | CholeraStudioTestSuite.java | |
package: | mapreduce | |
source folder: | testing/src/test/java |