Skip to content

Commit 3015a84

Browse files
author
xianxing
committed
[bugfix][hbase] fix deliver a null string causes dimensional table timeout problem
1 parent af5c3bb commit 3015a84

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

  • chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup

chunjun-connectors/chunjun-connector-hbase-base/src/main/java/com/dtstack/chunjun/connector/hbase/table/lookup/HBaseLruTableFunction.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,31 @@ public void run() {
107107
byte[] key = serde.getRowKey(rowKey);
108108
String keyStr = new String(key);
109109
try {
110-
Get get = new Get(key);
111-
Result result = table.get(get);
112-
if (!result.isEmpty()) {
113-
RowData data = serde.convertToNewRow(result);
114-
if (openCache()) {
115-
sideCache.putCache(
116-
keyStr,
117-
CacheObj.buildCacheObj(
118-
ECacheContentType.MultiLine,
119-
Collections.singletonList(data)));
120-
}
121-
future.complete(Collections.singletonList(data));
122-
} else {
123-
dealMissKey(future);
124-
if (openCache()) {
125-
sideCache.putCache(keyStr, CacheMissVal.getMissKeyObj());
110+
if (!keyStr.isEmpty()) {
111+
Get get = new Get(key);
112+
Result result = table.get(get);
113+
if (!result.isEmpty()) {
114+
RowData data = serde.convertToNewRow(result);
115+
if (openCache()) {
116+
sideCache.putCache(
117+
keyStr,
118+
CacheObj.buildCacheObj(
119+
ECacheContentType.MultiLine,
120+
Collections.singletonList(data)));
121+
}
122+
future.complete(Collections.singletonList(data));
123+
return;
126124
}
127125
}
126+
dealMissKey(future);
127+
if (openCache()) {
128+
sideCache.putCache(keyStr, CacheMissVal.getMissKeyObj());
129+
}
130+
128131
} catch (IOException e) {
129132
LOG.error("record:" + keyStr);
130133
LOG.error("get side record exception:" + e);
131-
future.complete(Collections.emptyList());
134+
dealMissKey(future);
132135
}
133136
}
134137
});

0 commit comments

Comments
 (0)