Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@locus.apache.org Received: (qmail 24092 invoked from network); 4 Jan 2009 07:25:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2009 07:25:07 -0000 Received: (qmail 91677 invoked by uid 500); 4 Jan 2009 07:25:07 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 91643 invoked by uid 500); 4 Jan 2009 07:25:07 -0000 Mailing-List: contact hbase-dev-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-dev@hadoop.apache.org Received: (qmail 91631 invoked by uid 99); 4 Jan 2009 07:25:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jan 2009 23:25:07 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2009 07:25:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 67995234C48B for ; Sat, 3 Jan 2009 23:24:46 -0800 (PST) Message-ID: <2112515162.1231053886423.JavaMail.jira@brutus> Date: Sat, 3 Jan 2009 23:24:46 -0800 (PST) From: "stack (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Updated: (HBASE-1090) Atomic Check And Save in HTable In-Reply-To: <1470049813.1230352784296.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] stack updated HBASE-1090: ------------------------- Attachment: 1090v3.patch Michael, the test fails for me. It seems as though it has to do with your returning a Boolean from checkAndSave. I think if you change it to return the primitive boolean type, it should work. The attached patch applies (v2 doesn't apply since I added your other patch). You might move the testCheckAndSave up in TestHTable so its first and runs first before all others while your debugging to save yourself some time. Good stuff (otherwise patch looks good to me). > Atomic Check And Save in HTable > ------------------------------- > > Key: HBASE-1090 > URL: https://issues.apache.org/jira/browse/HBASE-1090 > Project: Hadoop HBase > Issue Type: New Feature > Reporter: Michael Gottesman > Priority: Minor > Attachments: 1090v3.patch, hbase-1090.patch, hbase-1090v2.patch > > > Check And Save is a simple operation where one gives both a BatchUpdate with updates and a Map mapping columns to expected values (byte[] -> byte[]). The operation works as follows: > 1. Server gets locks on row. > 2. Server checks that the actual values of the specified columns match the given expected values > 3. If False, return False, if True update the row > 4. Unlock row. > Pretty simple... but useful. > Included in the attached patch are the necessary updates for HTable, HRegionServer, RegionServerInterface, and HRegion. I also added a small unit test to HTable where the test checks that checkAndSave succeeds when the expected values line up and fail when the values are different. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.