用于批量删除 hbase 行的 Spark 程序会抛出 AbstractMethodError



以下是我在 Spark 应用程序中的代码块,用于从 hbase 表中删除一组行键(重新分区的行键(,

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>

当我运行应用程序时,我得到了其中一个日志方法的抽象方法错误,

org.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]

我是否缺少任何依赖项罐子还是由于罐子冲突?提前致谢

我使用的是带有Spark 1.5.1的CDH5.5.7罐子,但与Spark-hbase相关的罐子指向cdh5.7.0。

然后我将CDH版本升级到5.10.2,并使所有其他jar与cdh5.10.2兼容,从而解决了AbstractMethodError。

相关内容

  • 没有找到相关文章