public class HadoopDataSource<K,V> extends GenericDataSource<HadoopInputFormatWrapper<K,V>>
HadoopDataSource source = new HadoopDataSource(new org.apache.hadoop.mapred.TextInputFormat(), new JobConf(), "Input Lines");
org.apache.hadoop.mapred.TextInputFormat.addInputPath(source.getJobConf(), new Path(dataInput));
Note that it is possible to provide custom data type converter.
The HadoopDataSource provides two different standard converters:
* WritableWrapperConverter: Converts Hadoop Types to a record that contains a WritableComparableWrapper (key) and a WritableWrapper
* DefaultHadoopTypeConverter: Converts the standard hadoop types (longWritable, Text) to Stratosphere's standard types.| Constructor and Description |
|---|
HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat) |
HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat,
org.apache.hadoop.mapred.JobConf jobConf) |
HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat,
org.apache.hadoop.mapred.JobConf jobConf,
String name) |
HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat,
org.apache.hadoop.mapred.JobConf jobConf,
String name,
HadoopTypeConverter<K,V> conv) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.mapred.JobConf |
getJobConf() |
accept, getFormatWrapper, getStatisticsKey, getUserCodeWrapper, setStatisticsKey, toStringpublic HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat, org.apache.hadoop.mapred.JobConf jobConf, String name, HadoopTypeConverter<K,V> conv)
hadoopFormat - Implementation of a Hadoop input formatjobConf - JobConf object (Hadoop)name - Name of the DataSourceconv - Definition of a custom type converter DefaultHadoopTypeConverter.public HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat, org.apache.hadoop.mapred.JobConf jobConf, String name)
public HadoopDataSource(org.apache.hadoop.mapred.InputFormat<K,V> hadoopFormat, org.apache.hadoop.mapred.JobConf jobConf)
Copyright © 2013–2014. All rights reserved.