Skip to content

Commit

Permalink
HBASE-22634 Improve performance of BufferedMutator
Browse files Browse the repository at this point in the history
Corrected unit test when neither hbase.htable.threads.max nor
hbase.client.max.total.tasks are set
  • Loading branch information
sbarnoud060710 committed Jun 28, 2019
1 parent ce6db03 commit 56607db
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
* @see Connection
* @since 1.0.0
*/
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IS2_INCONSISTENT_SYNC",
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")
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class BufferedMutatorImpl implements BufferedMutator {
Expand Down Expand Up @@ -304,7 +306,7 @@ public void flush() throws InterruptedIOException, RetriesExhaustedWithDetailsEx
boolean haveLocked = false;
if (writeBufferPeriodicFlushTimer != null) {
lock.lock();
haveLocked = false; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end
haveLocked = true; // make sure to unlock even if writeBufferPeriodicFlushTimer is set to null before the end
}
try {
checkClose();
Expand Down

0 comments on commit 56607db

Please sign in to comment.