Skip to content

Commit 56607db

Browse files
author
sbarnoud060710
committed
HBASE-22634 Improve performance of BufferedMutator
Corrected unit test when neither hbase.htable.threads.max nor hbase.client.max.total.tasks are set
1 parent ce6db03 commit 56607db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
* @see Connection
6464
* @since 1.0.0
6565
*/
66+
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IS2_INCONSISTENT_SYNC",
67+
justification="writeBufferPeriodicFlushTimer needs to be synchronized only when not null, and in mutual exclusion with close() and flush(true). However to needs to synchronize with flush(false) coming from mutate")
6668
@InterfaceAudience.Private
6769
@InterfaceStability.Evolving
6870
public class BufferedMutatorImpl implements BufferedMutator {
@@ -304,7 +306,7 @@ public void flush() throws InterruptedIOException, RetriesExhaustedWithDetailsEx
304306
boolean haveLocked = false;
305307
if (writeBufferPeriodicFlushTimer != null) {
306308
lock.lock();
307-
haveLocked = false; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end
309+
haveLocked = true; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end
308310
}
309311
try {
310312
checkClose();

0 commit comments

Comments
 (0)