Skip to content

Commit

Permalink
optimize HBaseAsyncWriteExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
caojiajun committed Nov 2, 2023
1 parent 46f7ec3 commit c3eb5e7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,17 @@ public void run() {
flushDelete(deleteBuffer);
}
}
} catch (Exception e) {
} catch (Throwable e) {
logger.error("hbase async write error", e);
}
}
}

private void flushPuts(List<Put> putBuffer) {
if (putBuffer.isEmpty()) {
return;
}
int size = putBuffer.size();
if (size <= 0) return;
hBaseTemplate.put(hbaseTableName(), putBuffer);
putBuffer.clear();
if (logger.isDebugEnabled()) {
Expand All @@ -146,8 +148,10 @@ private void flushPuts(List<Put> putBuffer) {
}

private void flushDelete(List<Delete> deleteBuffer) {
if (deleteBuffer.isEmpty()) {
return;
}
int size = deleteBuffer.size();
if (size <= 0) return;
hBaseTemplate.delete(hbaseTableName(), deleteBuffer);
deleteBuffer.clear();
if (logger.isDebugEnabled()) {
Expand Down

0 comments on commit c3eb5e7

Please sign in to comment.