org.infinispan.hadoop.sample.OutputConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mapreduce-sample Show documentation
Show all versions of mapreduce-sample Show documentation
Map reduce sample using Infinispan InputFormat/OutputFormat
package org.infinispan.hadoop.sample;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.infinispan.hadoop.KeyValueConverter;
/***
* Simple KeyValueConverter to be used with Reducers that operate on Writables, allowing to write simple primitives to
* the cache
*
* @author Pedro Ruivo
* @author gustavonalle
*/
public class OutputConverter implements KeyValueConverter {
@Override
public String convertKey(Text key) {
return key.toString();
}
@Override
public Integer convertValue(IntWritable value) {
return value.get();
}
}