Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@locus.apache.org Received: (qmail 71738 invoked from network); 30 Dec 2008 19:54:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Dec 2008 19:54:05 -0000 Received: (qmail 74513 invoked by uid 500); 30 Dec 2008 19:54:05 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 74354 invoked by uid 500); 30 Dec 2008 19:54:05 -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 74343 invoked by uid 99); 30 Dec 2008 19:54:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Dec 2008 11:54:05 -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; Tue, 30 Dec 2008 19:54:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5AA68234C4A9 for ; Tue, 30 Dec 2008 11:53:44 -0800 (PST) Message-ID: <1314453496.1230666824370.JavaMail.jira@brutus> Date: Tue, 30 Dec 2008 11:53:44 -0800 (PST) From: "Andrew Purtell (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (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:comment-tabpanel&focusedCommentId=12659913#action_12659913 ] Andrew Purtell commented on HBASE-1090: --------------------------------------- I think you are thinking of the atomic increment and decrement stuff that jgray contributed in HBASE-803. > 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: hbase-1090.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.