Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 10139 invoked from network); 27 Nov 2007 19:24:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Nov 2007 19:24:07 -0000 Received: (qmail 94843 invoked by uid 500); 27 Nov 2007 19:23:55 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 94487 invoked by uid 500); 27 Nov 2007 19:23:54 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 94478 invoked by uid 99); 27 Nov 2007 19:23:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2007 11:23:54 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2007 19:24:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7751471422B for ; Tue, 27 Nov 2007 11:23:43 -0800 (PST) Message-ID: <20220010.1196191423486.JavaMail.jira@brutus> Date: Tue, 27 Nov 2007 11:23:43 -0800 (PST) From: "Jim Kellerman (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Updated: (HADOOP-2261) [hbase] Change abort to finalize; does nothing if commit ran successfully In-Reply-To: <6581179.1195710703386.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/HADOOP-2261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jim Kellerman updated HADOOP-2261: ---------------------------------- Status: Patch Available (was: Reopened) > [hbase] Change abort to finalize; does nothing if commit ran successfully > ------------------------------------------------------------------------- > > Key: HADOOP-2261 > URL: https://issues.apache.org/jira/browse/HADOOP-2261 > Project: Hadoop > Issue Type: Improvement > Components: contrib/hbase > Reporter: stack > Assignee: Jim Kellerman > Fix For: 0.16.0 > > Attachments: patch.txt > > > From Michael Bieniosek: > {code}I'm trying to do an update row, so I write code like: > long lockid = table.startUpdate(new Text(article.getName())); try { > for (File articleInfo: article.listFiles(new NonDirectories())) { articleTable.put(lockid, columnName(articleInfo.getName()), readFile(articleInfo)); } > table.commit(lockid); > } finally { > table.abort(lockid); > } > This doesn't work, because in the normal case it calls abort after commit. But I'm not sure what the code should be, eg.: > long lockid = table.startUpdate(new Text(article.getName())); try { > for (File articleInfo: article.listFiles(new NonDirectories())) { articleTable.put(lockid, columnName(articleInfo.getName()), readFile(articleInfo)); } > table.commit(lockid); > } catch (IOException e) { > table.abort(lockid); > throw e; > } catch (RuntimeException e) { > table.abort(lockid); > throw e; > } > This gets unwieldy very quickly. Could you maybe change abort() to finalize() which either aborts or does nothing if a commit was successful? > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.