org.infinispan.hadoop.sample.InputConverter 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.LongWritable;
import org.apache.hadoop.io.Text;
import org.infinispan.hadoop.KeyValueConverter;
/***
* Simple KeyValueConverter used to adapt mapper that operates on Writables
*
* @author Pedro Ruivo
* @author gustavonalle
*/
public class InputConverter implements KeyValueConverter {
@Override
public LongWritable convertKey(Integer key) {
return new LongWritable((long) key);
}
@Override
public Text convertValue(String value) {
return new Text(value);
}
}