Return-Path: Delivered-To: apmail-hadoop-hbase-commits-archive@minotaur.apache.org Received: (qmail 63074 invoked from network); 9 Feb 2010 19:20:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 19:20:26 -0000 Received: (qmail 21251 invoked by uid 500); 9 Feb 2010 19:20:25 -0000 Delivered-To: apmail-hadoop-hbase-commits-archive@hadoop.apache.org Received: (qmail 21212 invoked by uid 500); 9 Feb 2010 19:20:25 -0000 Mailing-List: contact hbase-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-commits@hadoop.apache.org Received: (qmail 21203 invoked by uid 99); 9 Feb 2010 19:20:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 19:20:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 19:20:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DDAC52388897; Tue, 9 Feb 2010 19:20:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r908161 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HTable.java Date: Tue, 09 Feb 2010 19:20:01 -0000 To: hbase-commits@hadoop.apache.org From: stack@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100209192001.DDAC52388897@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stack Date: Tue Feb 9 19:20:01 2010 New Revision: 908161 URL: http://svn.apache.org/viewvc?rev=908161&view=rev Log: HBASE-2185 HTable - put(Put) , put(List writeBufferSize) { - flushCommits(); - } + doPut(Arrays.asList(put)); } /** @@ -462,6 +458,19 @@ * @since 0.20.0 */ public synchronized void put(final List puts) throws IOException { + doPut(puts); + } + + /** + * Internal helper method. + * Need to synchronize this instance to prevent race conditions on the internal + * data structures. + *

+ * If autoFlush is false, the update is buffered. + * @param puts + * @throws IOException + */ + private void doPut(final List puts) throws IOException { for (Put put : puts) { validatePut(put); writeBuffer.add(put); @@ -471,7 +480,7 @@ flushCommits(); } } - + /** * Atomically increments a column value. If the column value already exists * and is not a big-endian long, this could throw an exception.