diff --git a/client-adapter/example/pom.xml b/client-adapter/example/pom.xml
index 7433e948..f21649db 100644
--- a/client-adapter/example/pom.xml
+++ b/client-adapter/example/pom.xml
@@ -55,6 +55,7 @@
maven-jar-plugin
+ 3.0.2
true
diff --git a/client-adapter/hbase/pom.xml b/client-adapter/hbase/pom.xml
index 866bd31f..a48d7401 100644
--- a/client-adapter/hbase/pom.xml
+++ b/client-adapter/hbase/pom.xml
@@ -84,25 +84,6 @@
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 2.4
-
-
- jar-with-dependencies
-
-
-
-
- make-assembly
- package
-
- single
-
-
-
-
diff --git a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
index 97a7bd70..88fa9a4a 100644
--- a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
+++ b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/HbaseAdapter.java
@@ -10,6 +10,7 @@ import javax.sql.DataSource;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
@@ -41,7 +42,6 @@ public class HbaseAdapter implements OuterAdapter {
private Connection conn;
private HbaseSyncService hbaseSyncService;
private HbaseTemplate hbaseTemplate;
- private Configuration hbaseConfig;
@Override
public void init(OuterAdapterConfig configuration) {
@@ -62,7 +62,7 @@ public class HbaseAdapter implements OuterAdapter {
Map propertites = configuration.getProperties();
- hbaseConfig = HBaseConfiguration.create();
+ Configuration hbaseConfig = HBaseConfiguration.create();
propertites.forEach(hbaseConfig::set);
conn = ConnectionFactory.createConnection(hbaseConfig);
hbaseTemplate = new HbaseTemplate(conn);
@@ -103,7 +103,7 @@ public class HbaseAdapter implements OuterAdapter {
String hbaseTable = config.getHbaseOrm().getHbaseTable();
long rowCount = 0L;
try {
- HTable table = new HTable(hbaseConfig, hbaseTable);
+ HTable table = (HTable) conn.getTable(TableName.valueOf(hbaseTable));
Scan scan = new Scan();
scan.setFilter(new FirstKeyOnlyFilter());
ResultScanner resultScanner = table.getScanner(scan);
diff --git a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/TypeUtil.java b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/TypeUtil.java
index 07aad00f..f90e5bd8 100644
--- a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/TypeUtil.java
+++ b/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/support/TypeUtil.java
@@ -92,6 +92,7 @@ public class TypeUtil {
return b;
}
+ @SuppressWarnings("unchecked")
public static T toObject(byte[] bytes, Class clazz) {
if (bytes == null) {
return null;
@@ -132,10 +133,10 @@ public class TypeUtil {
} else {
throw new IllegalArgumentException("mismatch class type");
}
- // noinspection unchecked
return (T) res;
}
+ @SuppressWarnings("unchecked")
public static T toObject(byte[] bytes, Type type) {
if (bytes == null) {
return null;
@@ -182,7 +183,6 @@ public class TypeUtil {
} else {
throw new IllegalArgumentException("mismatch class type");
}
- // noinspection unchecked
return (T) res;
}
}
diff --git a/client-adapter/launcher/assembly.xml b/client-adapter/launcher/assembly.xml
new file mode 100644
index 00000000..7bb12314
--- /dev/null
+++ b/client-adapter/launcher/assembly.xml
@@ -0,0 +1,34 @@
+
+ canal-adapter
+
+ tar.gz
+
+
+
+ ${project.build.directory}
+ /
+
+ *.jar
+
+
+
+
+ ${project.build.directory}/lib
+ /lib/
+
+ *.jar
+
+
+
+
+ ${project.build.directory}/config
+ /config/
+
+ **
+
+
+
+ /
+
\ No newline at end of file
diff --git a/client-adapter/launcher/pom.xml b/client-adapter/launcher/pom.xml
index d5e43708..7d54cd58 100644
--- a/client-adapter/launcher/pom.xml
+++ b/client-adapter/launcher/pom.xml
@@ -93,7 +93,7 @@
- canal-client-launcher
+ canal-adapter-launcher
org.springframework.boot
@@ -145,6 +145,24 @@
+
+ maven-assembly-plugin
+
+ false
+
+ assembly.xml
+
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
\ No newline at end of file