Skip to content

Commit 1f48d45

Browse files
author
dapeng
committed
异步维表
1 parent 5d71d4a commit 1f48d45

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

hbase/hbase-side/hbase-async-side/src/main/java/com/dtstack/flink/sql/side/hbase/HbaseAsyncReqRow.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,26 @@ public void open(Configuration parameters) throws Exception {
9898
super.open(parameters);
9999
AbstractSideTableInfo sideTableInfo = sideInfo.getSideTableInfo();
100100
HbaseSideTableInfo hbaseSideTableInfo = (HbaseSideTableInfo) sideTableInfo;
101+
Map<String, Object> hbaseConfig = hbaseSideTableInfo.getHbaseConfig();
101102

102103
ExecutorService executorService =new ThreadPoolExecutor(DEFAULT_POOL_SIZE, DEFAULT_POOL_SIZE,
103104
0L, TimeUnit.MILLISECONDS,
104105
new LinkedBlockingQueue<>(), new DTThreadFactory("hbase-aysnc"));
105106

106107
Config config = new Config();
107108
config.overrideConfig(HbaseConfigUtils.KEY_HBASE_ZOOKEEPER_QUORUM, hbaseSideTableInfo.getHost());
108-
config.overrideConfig(HbaseConfigUtils.KEY_HBASE_ZOOKEEPER_ZNODE_QUORUM_ASYNC, hbaseSideTableInfo.getParent());
109-
110-
if (hbaseSideTableInfo.isKerberosAuthEnable()) {
111-
fillAsyncKerberosConfig(config, hbaseSideTableInfo);
109+
config.overrideConfig(HbaseConfigUtils.KEY_HBASE_ZOOKEEPER_ZNODE_QUORUM, hbaseSideTableInfo.getParent());
110+
HbaseConfigUtils.loadKrb5Conf(hbaseConfig);
111+
hbaseConfig.entrySet().forEach(entity -> {
112+
config.overrideConfig(entity.getKey(), (String) entity.getValue());
113+
});
114+
115+
if (HbaseConfigUtils.asyncOpenKerberos(hbaseConfig)) {
116+
String jaasStr = HbaseConfigUtils.buildJaasStr(hbaseConfig);
117+
String jaasFilePath = HbaseConfigUtils.creatJassFile(jaasStr);
118+
config.overrideConfig(HbaseConfigUtils.KEY_JAVA_SECURITY_AUTH_LOGIN_CONF, jaasFilePath);
112119
}
120+
113121
hBaseClient = new HBaseClient(config, executorService);
114122

115123
try {

0 commit comments

Comments
 (0)