aboutsummaryrefslogtreecommitdiff
path: root/mapreduce/Mapper.java
diff options
context:
space:
mode:
authorgithub-classroom[bot] <66690702+github-classroom[bot]@users.noreply.github.com>2023-12-10 19:07:21 +0000
committerGitHub <noreply@github.com>2023-12-10 19:07:21 +0000
commitcb491e82b5ce3dcb7e3c41973a46cb7dcbaa9008 (patch)
treec9c6a81111803facc4e3b677e394495cea696bc0 /mapreduce/Mapper.java
Initial commit
Diffstat (limited to 'mapreduce/Mapper.java')
-rw-r--r--mapreduce/Mapper.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/mapreduce/Mapper.java b/mapreduce/Mapper.java
new file mode 100644
index 0000000..c2da326
--- /dev/null
+++ b/mapreduce/Mapper.java
@@ -0,0 +1,22 @@
+package mapreduce;
+
+import java.util.Map;
+import java.util.concurrent.RecursiveTask;
+
+/**
+ *
+ * @author mph
+ * @param <IN> input type
+ * @param <K> key type
+ * @param <V> accumulator type
+ */
+public abstract class Mapper<IN, K, V> extends RecursiveTask<Map<K, V>> {
+ protected IN input;
+
+ /**
+ * @param anInput list of input items
+ */
+ public void setInput(IN anInput) {
+ input = anInput;
+ }
+}