hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-2261) [hbase] Change abort to finalize; does nothing if commit ran successfully
Date Tue, 27 Nov 2007 17:19:43 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-2261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545925
] 

stack commented on HADOOP-2261:
-------------------------------

Jim, IMO, having users run an 'abort' on every transaction as the hbase update idiom is a
little odd.  Michael's original suggestion of finalize, though a better method name, is problematic
since its a method that already exists on Object (and means something else).  Perhaps 'cleanup'
rather than abort?

> [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
>
>
> 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.


Mime
View raw message