Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Nov 14, 2024
1 parent 3ec5201 commit aeae275
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public boolean tryHttpConnection(String host) {
* @param record
* @throws IOException
*/
public synchronized void writeRecord(String database, String table, byte[] record) {
public void writeRecord(String database, String table, byte[] record) {
checkFlushException();
String bufferKey = getTableIdentifier(database, table);
BatchRecordBuffer buffer =
Expand Down Expand Up @@ -233,19 +233,15 @@ public synchronized void writeRecord(String database, String table, byte[] recor
}
}

public synchronized boolean bufferFullFlush(String bufferKey) {
public boolean bufferFullFlush(String bufferKey) {
return doFlush(bufferKey, false, true);
}

public synchronized boolean intervalFlush() {
return doFlush(null, false, false);
}

/**
* Force flush and wait for success.
* @return
*/
public synchronized boolean forceFlush() {
public boolean forceFlush() {
return doFlush(null, true, false);
}

Expand Down Expand Up @@ -418,11 +414,6 @@ public void run() {
load(bf.getLabelName(), bf);
}
}

if (flushQueue.size() < flushQueueSize) {
// Avoid waiting for 2 rounds of intervalMs
doFlush(null, false, false);
}
} catch (Exception e) {
log.logError("worker running error", e);
exception.set(e);
Expand Down

0 comments on commit aeae275

Please sign in to comment.