以下是我在spark应用程序中的代码块,用于从hbase表中删除一组rowkeys(rePartitionedRowKeys),
hbaseContext.bulkDelete[Array[Byte]](rePartitionedRowKeys,
TableName.valueOf(hbaseTableName),
putRecord => new Delete(putRecord), batchSize)
pom.xml中的相关依赖项是,
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-spark</artifactId>
<version>1.2.0-cdh5.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.10</artifactId>
<version>1.6.0-cdh5.7.0</version>
<scope>provided</scope>
</dependency>
当我运行应用程序时,我得到一个日志方法
的AbstractMethodErrororg.apache.spark.SparkException: Job aborted due to stage failure: Task 3 in stage 4.0 failed 4 times, most recent failure: Lost task 3.3 in stage 4.0 (TID 17, c175vjt.int.westgroup.com, executor 2): java.lang.AbstractMethodError: org.apache.hadoop.hbase.spark.HBaseContext.initializeLogIfNecessary(Z)V
at org.apache.spark.Logging$class.log(Logging.scala:50)
at org.apache.hadoop.hbase.spark.HBaseContext.log(HBaseContext.scala:60)
at org.apache.spark.Logging$class.logDebug(Logging.scala:62)
at org.apache.hadoop.hbase.spark.HBaseContext.logDebug(HBaseContext.scala:60)
at org.apache.hadoop.hbase.spark.HBaseContext.applyCreds(HBaseContext.scala:235)
at org.apache.hadoop.hbase.spark.HBaseContext.org$apache$hadoop$hbase$spark$HBaseContext$$hbaseForeachPartition(HBaseContext.scala:482)
at org.apache.hadoop.hbase.spark.HBaseContext$$anonfun$org$apache$hadoop$hbase$spark$HBaseContext$$bulkMutation$1.apply(HBaseContext.scala:322)
at org.apache.hadoop.hbase.spark.HBaseContext$$anonfun$org$apache$hadoop$hbase$spark$HBaseContext$$bulkMutation$1.apply(HBaseContext.scala:322)
at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$33.apply(RDD.scala:920)
at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$33.apply(RDD.scala:920)
at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1866)
at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1866)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
at org.apache.spark.scheduler.Task.run(Task.scala:89)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Driver stacktrace:
at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1457) ~[spark-assembly-1.6.0-cdh5.10.2-hadoop2.6.0-cdh5.10.2.jar:na]
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1445) ~[spark-assembly-1.6.0-cdh5.10.2-hadoop2.6.0-cdh5.10.2.jar:na]
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1444) ~[spark-assembly-1.6.0-cdh5.10.2-hadoop2.6.0-cdh5.10.2.jar:na]
我是否遗漏了任何依赖关系罐,还是因为jar冲突? 提前致谢
答案 0 :(得分:0)
我正在使用带有Spark 1.5.1的CDH5.5.7 jar,但spark-hbase相关的jar指向cdh5.7.0。
然后我将CDH版本升级到5.10.2并使所有其他jar兼容cdh5.10.2解决了AbstractMethodError。