我在hadoop 2.2.0中编写了一个作业,它读取了输入文件,并在cassandra 2.0中批量加载数据
然而我得到了错误(因为编译和执行中使用的hadoop的分布不同)
[root@hadoopslave ~]# hadoop jar ultra-bulkloader-hadoop.jar
14/07/10 01:08:01 INFO client.RMProxy: Connecting to ResourceManager at /10.211.212.157:8040
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
at org.apache.cassandra.hadoop.BulkOutputFormat.checkOutputSpecs(BulkOutputFormat.java:35)
at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:456)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:342)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1268)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1265)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1286)
at com.home.task.hadoop.bulkloader.BulkLoaderDriver.run(BulkLoaderDriver.java:38)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at com.home.task.hadoop.bulkloader.BulkLoaderDriver.main(BulkLoaderDriver.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
cassandra 2.0支持的hadoop版本是什么
答案 0 :(得分:0)
此修复程序可在cassandra 2.0.6
上找到答案 1 :(得分:0)
我修复了类似的问题,将api从 cassandra 1.1.1 更新为 cassandra 2.0.7 ,因为我正在运行 cassandra 2.0.7
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
~ <cassandra.version>2.0.7</cassandra.version>
</properties>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>${cassandra.version}</version>
<exclusions>
<exclusion>
<artifactId>libthrift</artifactId>
<groupId>org.apache.thrift</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-thrift</artifactId>
<version>${cassandra.version}</version>
<exclusions>
<exclusion>
<artifactId>libthrift</artifactId>
<groupId>org.apache.thrift</groupId>
</exclusion>
</exclusions>
</dependency>