You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jg...@apache.org on 2009/08/18 01:46:53 UTC

svn commit: r805218 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HTable.java

Author: jgray
Date: Mon Aug 17 23:46:53 2009
New Revision: 805218

URL: http://svn.apache.org/viewvc?rev=805218&view=rev
Log:
HBASE-1770 HTable.setWriteBufferSize does not flush the writeBuffer when its size is set to a value lower than its current size (Mathias via jgray)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=805218&r1=805217&r2=805218&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Aug 17 23:46:53 2009
@@ -10,6 +10,9 @@
                (Ken Weiner via jgray)
    HBASE-1763  Put writeToWAL methods do not have proper getter/setter names
                (second commit to fix compile error in hregion)
+   HBASE-1770  HTable.setWriteBufferSize does not flush the writeBuffer when
+               its size is set to a value lower than its current size.
+               (Mathias via jgray)
 
   OPTIMIZATIONS
 

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java?rev=805218&r1=805217&r2=805218&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java Mon Aug 17 23:46:53 2009
@@ -670,11 +670,17 @@
   }
 
   /**
-   * Set the size of the buffer in bytes
+   * Set the size of the buffer in bytes.
+   * If the new size is lower than the current size of data in the
+   * write buffer, the buffer is flushed.
    * @param writeBufferSize
+   * @throws IOException
    */
-  public void setWriteBufferSize(long writeBufferSize) {
+  public void setWriteBufferSize(long writeBufferSize) throws IOException {
     this.writeBufferSize = writeBufferSize;
+    if(currentWriteBufferSize > writeBufferSize) {
+      flushCommits();
+    }
   }
 
   /**