openinx commented on a change in pull request #12369:
URL: https://github.com/apache/flink/pull/12369#discussion_r438030100



##########
File path: flink-connectors/flink-sql-connector-hbase/pom.xml
##########
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+       <parent>
+               <artifactId>flink-connectors</artifactId>
+               <groupId>org.apache.flink</groupId>
+               <version>1.12-SNAPSHOT</version>
+               <relativePath>..</relativePath>
+       </parent>
+       <modelVersion>4.0.0</modelVersion>
+
+       
<artifactId>flink-sql-connector-hbase_${scala.binary.version}</artifactId>
+       <name>flink-sql-connector-hbase</name>
+
+       <packaging>jar</packaging>
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.flink</groupId>
+                       
<artifactId>flink-connector-hbase_${scala.binary.version}</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+       </dependencies>
+
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-shade-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>shade-flink</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>shade</goal>
+                                               </goals>
+                                               <configuration>
+                                                       
<shadeTestJar>false</shadeTestJar>
+                                                       <artifactSet>
+                                                               <includes>
+                                                                       
<include>org.apache.flink:flink-connector-hbase_${scala.binary.version}</include>
+                                                                       
<include>org.apache.hbase:hbase-*</include>
+                                                                       
<include>org.apache.zookeeper:zookeeper</include>
+                                                                       
<include>org.apache.htrace:htrace-core</include>
+                                                                       
<include>com.google.guava:guava</include>
+                                                                       
<include>com.google.protobuf:protobuf-java</include>
+                                                                       
<include>com.yammer.metrics:metrics-core</include>
+                                                                       
<include>commons-logging:commons-logging</include>
+                                                                       
<include>commons-lang:commons-lang</include>
+                                                                       
<include>commons-configuration:commons-configuration</include>
+                                                                       
<include>commons-codec:commons-codec</include>
+                                                                       
<include>io.netty:netty-all</include>
+                                                               </includes>
+                                                               <excludes>
+                                                                       
<exclude>org.apache.hbase:hbase-metrics*</exclude>
+                                                                       
<exclude>org.apache.hbase:hbase-server*</exclude>
+                                                               </excludes>
+                                                       </artifactSet>
+                                                       <filters>
+                                                               <filter>
+                                                                       
<artifact>*:*</artifact>
+                                                                       
<excludes>
+                                                                               
<exclude>META-INF/services/com.fasterxml.**</exclude>
+                                                                               
<exclude>META-INF/services/org.apache.hadoop.**</exclude>
+                                                                               
<exclude>META-INF/services/javax.**</exclude>
+                                                                       
</excludes>
+                                                               </filter>
+                                                       </filters>
+                                                       <relocations>
+                                                               <!-- Force 
relocation of all HBase dependencies. -->
+                                                               <relocation>
+                                                                       
<pattern>org.apache.zookeeper</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.org.apache.zookeeper</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>org.apache.htrace</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.org.apache.htrace</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>com.google</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.com.google</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>com.yammer.metrics</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.com.yammer.metrics</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>commons-logging</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.commons-logging</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>commons-lang</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.commons-lang</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>commons-configuration</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.commons-configuration</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>commons-codec</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.commons-codec</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>io.netty:netty-all</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.com.yammer.metrics</shadedPattern>
+                                                               </relocation>
+                                                               <relocation>
+                                                                       
<pattern>org.apache.hbase</pattern>
+                                                                       
<shadedPattern>org.apache.flink.hbase.shaded.org.apache.hbase</shadedPattern>

Review comment:
       I think here we should also exclude the class 
`org.apache.hadoop.hbase.CellScanner`, otherwise  our 
`KeyValueCodec$KeyValueDecoder` will extend the 
`org.apache.flink.hbase.shaded.org.apache.hadoop.hbase.CellScanner` class, 
while the server side did not also have this class, it will throw the 
exception: 
   
   ```
   Caused by: org.apache.flink.runtime.JobException: Creating the input splits 
caused an error: java.lang.IncompatibleClassChangeError: Class 
org.apache.hadoop.hbase.codec.KeyValueCodec$KeyValueDecoder does not implement 
the requested interface org.apache.hadoop.hbase.CellScanner
        at 
org.apache.flink.runtime.executiongraph.ExecutionJobVertex.<init>(ExecutionJobVertex.java:272)
        at 
org.apache.flink.runtime.executiongraph.ExecutionGraph.attachJobGraph(ExecutionGraph.java:814)
        at 
org.apache.flink.runtime.executiongraph.ExecutionGraphBuilder.buildGraph(ExecutionGraphBuilder.java:228)
        at 
org.apache.flink.runtime.scheduler.SchedulerBase.createExecutionGraph(SchedulerBase.java:269)
        at 
org.apache.flink.runtime.scheduler.SchedulerBase.createAndRestoreExecutionGraph(SchedulerBase.java:242)
        at 
org.apache.flink.runtime.scheduler.SchedulerBase.<init>(SchedulerBase.java:229)
        at 
org.apache.flink.runtime.scheduler.DefaultScheduler.<init>(DefaultScheduler.java:119)
        at 
org.apache.flink.runtime.scheduler.DefaultSchedulerFactory.createInstance(DefaultSchedulerFactory.java:103)
        at 
org.apache.flink.runtime.jobmaster.JobMaster.createScheduler(JobMaster.java:284)
        at 
org.apache.flink.runtime.jobmaster.JobMaster.<init>(JobMaster.java:272)
        at 
org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.createJobMasterService(DefaultJobMasterServiceFactory.java:98)
        at 
org.apache.flink.runtime.jobmaster.factories.DefaultJobMasterServiceFactory.createJobMasterService(DefaultJobMasterServiceFactory.java:40)
        at 
org.apache.flink.runtime.jobmaster.JobManagerRunnerImpl.<init>(JobManagerRunnerImpl.java:140)
        at 
org.apache.flink.runtime.dispatcher.DefaultJobManagerRunnerFactory.createJobManagerRunner(DefaultJobManagerRunnerFactory.java:84)
        at 
org.apache.flink.runtime.dispatcher.Dispatcher.lambda$createJobManagerRunner$6(Dispatcher.java:387)
        ... 7 more
   Caused by: org.apache.hadoop.hbase.DoNotRetryIOException: 
java.lang.IncompatibleClassChangeError: Class 
org.apache.hadoop.hbase.codec.KeyValueCodec$KeyValueDecoder does not implement 
the requested interface org.apache.hadoop.hbase.CellScanner
        at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.translateException(RpcRetryingCaller.java:248)
        at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:221)
        at 
org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:388)
        at 
org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.call(ScannerCallableWithReplicas.java:362)
        at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:142)
        at 
org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:80)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
   Caused by: java.lang.IncompatibleClassChangeError: Class 
org.apache.hadoop.hbase.codec.KeyValueCodec$KeyValueDecoder does not implement 
the requested interface org.apache.hadoop.hbase.CellScanner
        at 
org.apache.hadoop.hbase.protobuf.ResponseConverter.getResults(ResponseConverter.java:419)
        at 
org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:284)
        at 
org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:62)
        at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:219)
        ... 7 more
   
   End of exception on server side>
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to