You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@omid.apache.org by yo...@apache.org on 2018/12/03 13:46:21 UTC
[26/50] [abbrv] incubator-omid git commit: OMID-115 Remove
unnecessary throw of IOException from TTable.markPutAsCommitted()
OMID-115 Remove unnecessary throw of IOException from TTable.markPutAsCommitted()
Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/2c087fd6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/2c087fd6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/2c087fd6
Branch: refs/heads/master
Commit: 2c087fd606d007075a88c8728a3844fce6287d8f
Parents: c856ae0
Author: James Taylor <ja...@apache.org>
Authored: Tue Oct 2 15:02:55 2018 -0700
Committer: Yonatan Gottesman <yo...@gmail.com>
Committed: Tue Nov 13 10:09:33 2018 +0200
----------------------------------------------------------------------
.../src/main/java/org/apache/omid/transaction/TTable.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/2c087fd6/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java b/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
index b7952a4..6458109 100644
--- a/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
+++ b/hbase-client/src/main/java/org/apache/omid/transaction/TTable.java
@@ -355,7 +355,7 @@ public class TTable implements Closeable {
* @param commitTimestamp timestamp to be used as commit timestamp
* @throws IOException if a remote or network exception occurs.
*/
- static public Put markPutAsCommitted(Put put, long timestamp, long commitTimestamp) throws IOException {
+ static public Put markPutAsCommitted(Put put, long timestamp, long commitTimestamp) {
final Put tsput = new Put(put.getRow(), timestamp);
propagateAttributes(put, tsput);
@@ -364,7 +364,13 @@ public class TTable implements Closeable {
for (Cell c : kvl) {
KeyValue kv = KeyValueUtil.ensureKeyValue(c);
Bytes.putLong(kv.getValueArray(), kv.getTimestampOffset(), timestamp);
- tsput.add(kv);
+ try {
+ tsput.add(kv);
+ } catch (IOException e) {
+ // The existing Put has this Cell, so the cloned one
+ // will never throw an IOException when it's added.
+ throw new RuntimeException(e);
+ }
tsput.addColumn(CellUtil.cloneFamily(kv),
CellUtils.addShadowCellSuffixPrefix(CellUtil.cloneQualifier(kv), 0, CellUtil.cloneQualifier(kv).length),
kv.getTimestamp(),