本文整理了Java中org.apache.hadoop.mapreduce.Mapper.map()
方法的一些代码示例,展示了Mapper.map()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mapper.map()
方法的具体详情如下:
包路径:org.apache.hadoop.mapreduce.Mapper
类名称:Mapper
方法名:map
[英]Called once for each key/value pair in the input split. Most applications should override this, but the default is the identity function.
[中]为输入拆分中的每个键/值对调用一次。大多数应用程序都应该覆盖它,但默认的是identity函数。
代码示例来源:origin: apache/kylin
protected void doMap(KEYIN key, VALUEIN value, Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context)
throws IOException, InterruptedException {
super.map(key, value, context);
}
代码示例来源:origin: org.apache.kylin/kylin-engine-mr
protected void doMap(KEYIN key, VALUEIN value, Mapper<KEYIN, VALUEIN, KEYOUT, VALUEOUT>.Context context)
throws IOException, InterruptedException {
super.map(key, value, context);
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
if (ioEx) {
throw new IOException();
}
if (rtEx) {
throw new RuntimeException();
}
super.map(key, value, context);
}
}
代码示例来源:origin: locationtech/geowave
@Override
protected void map(
final LongWritable key,
final DoubleWritable value,
final org.apache.hadoop.mapreduce.Mapper.Context context)
throws IOException, InterruptedException {
long positiveKey = key.get();
double adjustedValue = value.get();
if (positiveKey < 0) {
positiveKey = -positiveKey - 1;
adjustedValue *= -1;
}
super.map(new LongWritable(positiveKey), new DoubleWritable(adjustedValue), context);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient
public void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
if (ioEx) {
throw new IOException();
}
if (rtEx) {
throw new RuntimeException();
}
super.map(key, value, context);
}
}
代码示例来源:origin: com.facebook.hadoop/hadoop-core
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
cleanup(context);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-mapred
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
cleanup(context);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-core
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
try {
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
} finally {
cleanup(context);
}
}
}
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
try {
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
} finally {
cleanup(context);
}
}
}
代码示例来源:origin: io.hops/hadoop-mapreduce-client-core
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
try {
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
} finally {
cleanup(context);
}
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-mapreduce-client-core
/**
* Expert users can override this method for more complete control over the
* execution of the Mapper.
* @param context
* @throws IOException
*/
public void run(Context context) throws IOException, InterruptedException {
setup(context);
try {
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
} finally {
cleanup(context);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!