Skip to content

Commit 3d91393

Browse files
committed
[feat][hbase] 任务结束时将数据写出
1 parent fea8a43 commit 3d91393

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

hbase/hbase-sink/src/main/java/com/dtstack/flink/sql/sink/hbase/HbaseOutputFormat.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,8 @@ private Map<String, Object> rowConvertMap(Row record) {
300300

301301
@Override
302302
public void close() throws IOException {
303-
if (conn != null) {
304-
conn.close();
305-
conn = null;
303+
if (!records.isEmpty()) {
304+
dealBatchOperation(records);
306305
}
307306

308307
if (scheduledFuture != null) {
@@ -311,6 +310,12 @@ public void close() throws IOException {
311310
executor.shutdownNow();
312311
}
313312
}
313+
314+
if (conn != null) {
315+
conn.close();
316+
conn = null;
317+
}
318+
314319
}
315320

316321
private HbaseOutputFormat() {

0 commit comments

Comments
 (0)