In the code below, what does Iterator<V>
and OutputCollector<K, V>
mean? Is it a special data type?
public void reduce(K key,
Iterator<V> values,
OutputCollector<K, V> output,
Reporter reporter) throws IOException {
In the code below, what does Iterator<V>
and OutputCollector<K, V>
mean? Is it a special data type?
public void reduce(K key,
Iterator<V> values,
OutputCollector<K, V> output,
Reporter reporter) throws IOException {
K stands for Key and V for Value, like in a HashMap. There isn't a Key class or a Value class that you have to instantiate or subclass, it's a semantic thing for generics. Those letters are only placeholders for whatever classes you decide should fill the Key and Value roles.
Those are Generic types. Check out the tutorial, it is really helpful.
http://download.oracle.com/javase/tutorial/extra/generics/index.html