Index: src/java/org/apache/hadoop/hbase/client/HTable.java =================================================================== --- src/java/org/apache/hadoop/hbase/client/HTable.java (revision 805192) +++ src/java/org/apache/hadoop/hbase/client/HTable.java (working copy) @@ -671,10 +671,16 @@ /** * Set the size of the buffer in bytes + * If the new size is lower than the current size of data in the write + * buffer, call flushCommits. * @param writeBufferSize + * @throws IOException */ - public void setWriteBufferSize(long writeBufferSize) { + public void setWriteBufferSize(long writeBufferSize) throws IOException { this.writeBufferSize = writeBufferSize; + if(currentWriteBufferSize > writeBufferSize) { + flushCommits(); + } } /**