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



##########
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:
       Hi I read the codes in hbase 
[repo](https://github.com/apache/hbase/blob/branch-1/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java#L1909).
 If client passed the correct class name `org.apache.hadoop.hbase.CellScanner`, 
then the region server will load the correct class for it ( from its own 
classpath), so in theory this exception 
`java.lang.IncompatibleClassChangeError: Class 
org.apache.hadoop.hbase.codec.KeyValueCodec$KeyValueDecoder does not implement 
the requested interface org.apache.hadoop.hbase.CellScanner` shouldn't be 
thrown.
   
   (I did not remember the way to reproduce this stacktrace now... ) Let's move 
this pull requests forward if the e2e test could pass.. Thanks.




----------------------------------------------------------------
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