Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Nov 15, 2024
1 parent fddfa30 commit 9f7d98a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ private synchronized boolean doFlush(
}

private synchronized boolean flush(String bufferKey, boolean waitUtilDone) {
if (bufferMap.isEmpty()) {
// bufferMap may have been flushed by other threads
return false;
}
if (null == bufferKey) {
boolean flush = false;
for (String key : bufferMap.keySet()) {
Expand All @@ -270,7 +274,7 @@ private synchronized boolean flush(String bufferKey, boolean waitUtilDone) {
} else if (bufferMap.containsKey(bufferKey)) {
flushBuffer(bufferKey);
} else {
throw new DorisBatchLoadException("buffer not found for key: " + bufferKey);
LOG.warn("buffer not found for key: {}, may be already flushed.", bufferKey);
}
if (waitUtilDone) {
waitAsyncLoadFinish();
Expand All @@ -281,6 +285,7 @@ private synchronized boolean flush(String bufferKey, boolean waitUtilDone) {
private synchronized void flushBuffer(String bufferKey) {
BatchRecordBuffer buffer = bufferMap.get(bufferKey);
buffer.setLabelName(labelGenerator.generateBatchLabel(buffer.getTable()));
LOG.debug("flush buffer for key {} with label {}", bufferKey, buffer.getLabelName());
putRecordToFlushQueue(buffer);
bufferMap.remove(bufferKey);
}
Expand Down

0 comments on commit 9f7d98a

Please sign in to comment.