From 3015a84e17dfef47a77f466473064728212756a5 Mon Sep 17 00:00:00 2001 From: xianxing Date: Mon, 11 Dec 2023 09:55:09 +0800 Subject: [PATCH] [bugfix][hbase] fix deliver a null string causes dimensional table timeout problem --- .../table/lookup/HBaseLruTableFunction.java | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup/HBaseLruTableFunction.java b/chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup/HBaseLruTableFunction.java index a8babf6a4b..088cf3edb0 100644 --- a/chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup/HBaseLruTableFunction.java +++ b/chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup/HBaseLruTableFunction.java @@ -107,28 +107,31 @@ public void run() { byte[] key = serde.getRowKey(rowKey); String keyStr = new String(key); try { - Get get = new Get(key); - Result result = table.get(get); - if (!result.isEmpty()) { - RowData data = serde.convertToNewRow(result); - if (openCache()) { - sideCache.putCache( - keyStr, - CacheObj.buildCacheObj( - ECacheContentType.MultiLine, - Collections.singletonList(data))); - } - future.complete(Collections.singletonList(data)); - } else { - dealMissKey(future); - if (openCache()) { - sideCache.putCache(keyStr, CacheMissVal.getMissKeyObj()); + if (!keyStr.isEmpty()) { + Get get = new Get(key); + Result result = table.get(get); + if (!result.isEmpty()) { + RowData data = serde.convertToNewRow(result); + if (openCache()) { + sideCache.putCache( + keyStr, + CacheObj.buildCacheObj( + ECacheContentType.MultiLine, + Collections.singletonList(data))); + } + future.complete(Collections.singletonList(data)); + return; } } + dealMissKey(future); + if (openCache()) { + sideCache.putCache(keyStr, CacheMissVal.getMissKeyObj()); + } + } catch (IOException e) { LOG.error("record:" + keyStr); LOG.error("get side record exception:" + e); - future.complete(Collections.emptyList()); + dealMissKey(future); } } });