- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 EMR 上运行以下代码,并给出了上述异常。有谁知道可能出了什么问题?我正在使用 avro-tools-1.77 来编译我的模式。
经过一番研究,我开始觉得这可能是一个 avro 问题,可以通过使用 Maven 编译和编辑依赖项或将 amazon hadoop 版本更改为以前的版本来修复。但是,我从未使用过 Maven,并且更改 hadoop 版本会弄乱我的许多其他代码。
public class MapReduceIndexing extends Configured implements Tool{
static int number_of_documents;
static DynamoStorage ds = new DynamoStorage();
public static class IndexMapper extends Mapper<AvroKey<DocumentSchema>, NullWritable, Text, IndexValue>{
public void map(AvroKey<DocumentSchema> key, NullWritable value, Context context) throws IOException, InterruptedException {
System.out.println("inside map start");
//some mapper code e.g.
for(String word : all_words.keySet()){
context.write(new Text(word), iv);
}
System.out.println("inside map end");
}
}
public static class IndexReducer extends Reducer<Text, IndexValue, AvroKey<CharSequence>, AvroValue<Integer>> {
@Override
public void reduce(Text key, Iterable<IndexValue> iterable_values, Context context) throws IOException, InterruptedException {
System.out.println("inside reduce start");
//some reducer code
System.out.println("inside reduce end");
}
}
public int run(String[] args) throws Exception {
Configuration conf = new Configuration();
Job job = new Job(conf, "indexing");
job.setJarByClass(MapReduceIndexing.class);
job.setJobName("Making inverted index");
FileInputFormat.setInputPaths(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
job.setInputFormatClass(AvroKeyInputFormat.class);
job.setMapperClass(IndexMapper.class);
AvroJob.setInputKeySchema(job, DocumentSchema.getClassSchema());
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(IndexValue.class);
job.setOutputFormatClass(AvroKeyValueOutputFormat.class);
job.setReducerClass(IndexReducer.class);
AvroJob.setOutputKeySchema(job, Schema.create(Schema.Type.STRING));
AvroJob.setOutputValueSchema(job, Schema.create(Schema.Type.INT));
return (job.waitForCompletion(true) ? 0 : 1);
}
public static void main(String[] args) throws Exception {
//setting input and output directories
AWSCredentials credentials = new BasicAWSCredentials("access key", "secret key");
AmazonS3 s3 = new AmazonS3Client(credentials);
ObjectListing object_listing = s3.listObjects(new ListObjectsRequest().withBucketName(args[2]));
number_of_documents = object_listing.getObjectSummaries().size();
int res = ToolRunner.run(new MapReduceIndexing(), args);
System.exit(res);
}}
最佳答案
检查 avro-tools 是否在您的编译类路径中。它包括一个 org.apache.hadoop.mapreduce.TaskAttemptContext
这可能与您的 jar 和/或集群中的版本冲突。如果您出于某种原因需要包含 avro-tools,则必须下载针对您的 Hadoop 版本编译的版本(Cloudera 在他们的 repository 中有此版本,但我不确定从哪里获得它以用于 EMR) ,或者自己编译 avro-tools。
关于java - Amazon Hadoop 2.4 + Avro 1.77 : Found interface org. apache.hadoop.mapreduce.TaskAttemptContext,但预期类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30115108/
到目前为止还没有找到解决我的特定问题的方法。它至少不起作用。这让我很疯狂。这个特殊的组合在谷歌空间中似乎并不多。据我所知,我的错误发生在作业进入映射器时。该作业的输入是 avro 模式的输出,虽然我也
我的 hadoop 应用程序在开始执行 map 0% reduce 0% 时执行它时出现了一些错误 它给出了某种错误 2002 年 6 月 17 日 16:21:44 信息 mapreduce.Job
我正在使用 hadoop 设计 mapreduce 作业。我决定创建一个自定义的 InputFormat。当我想在我的 Hortonworks 沙盒上运行该作业时,出现了这个错误: Error: Fo
我正在使用 CDH4 并使用新的 mapreduce API 编写了一个 MapReduce 应用程序。我已经针对 hadoop-core-1.0.3.jar 编译了它,当我在我的 Hadoop 集群
我是 hadoop 的新手。我正在编写将文本文件转换为 PDF 的 mapreduce 代码,但出现上述错误。在网上搜索问题后,我发现问题是 org.apache.hadoop.mapreduce.T
我刚刚在 Hortonworks HDP 2.1 上将 Pig 0.12.0 升级到 0.13.0 版本 当我尝试在脚本中使用 XMLLoader 时出现以下错误,即使我已经注册了 piggybank
我在使用 Hadoop 2.4.0 和 Nutch 2.2 时遇到了这个异常。 当我尝试运行这个命令时: ./hadoop jar apache-nutch-2.2.1.job org.apache.
我正在尝试在 EMR 上运行以下代码,并给出了上述异常。有谁知道可能出了什么问题?我正在使用 avro-tools-1.77 来编译我的模式。 经过一番研究,我开始觉得这可能是一个 avro 问题,可
命令:./crawl/urls/mydir XXXXX 2 在Hadoop-2.5.1和Nutch-2.2.1中运行该命令时,出现如下错误信息。 14/10/07 19:58:10 INFO mapr
我的配置: CouchBase 服务器 2.0 Sqoop 1.4.2(为 hadoop 版本 2.0.0 编译) 栈Hadoop CDH4.1.2 我想使用 CouchBase/Hadoop 连接器
我是一名优秀的程序员,十分优秀!