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/11/13 10:16:21 UTC

[29/50] [abbrv] incubator-omid git commit: OMID-116 Add addShadowCells argument to other TTable methods

OMID-116 Add addShadowCells argument to other TTable methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/557f120a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/557f120a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/557f120a

Branch: refs/heads/1.0.0
Commit: 557f120a5a2c46a3f78c57f30d4f25e154fe17b9
Parents: 2c087fd
Author: James Taylor <ja...@apache.org>
Authored: Tue Oct 2 16:54:58 2018 -0700
Committer: Yonatan Gottesman <yo...@gmail.com>
Committed: Tue Nov 13 10:09:33 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/omid/transaction/TTable.java  | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/557f120a/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 6458109..f9864da 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
@@ -600,28 +600,34 @@ public class TTable implements Closeable {
      *
      * @param transaction an instance of transaction to be used
      * @param puts        List of puts
+     * @param addShadowCell  denotes whether to add the shadow cell
      * @throws IOException if a remote or network exception occurs
      */
-    public void put(Transaction transaction, List<Put> puts) throws IOException {
+    public void put(Transaction transaction, List<Put> puts, boolean addShadowCells) throws IOException {
         List<Mutation> mutations = new ArrayList<>(puts.size());
         for (Put put : puts) {
-            mutations.add(putInternal(transaction, put, false));
+            mutations.add(putInternal(transaction, put, addShadowCells));
         }
         addMutations(mutations);
     }
 
+    public void put(Transaction transaction, List<Put> puts) throws IOException {
+        put(transaction, puts, false);
+    }
+
     /**
      * Transactional version of {@link Table#batch(List<? extends Row> rows)}
      *
      * @param transaction an instance of transaction to be used
      * @param rows        List of rows that must be instances of Put or Delete
+     * @param addShadowCell  denotes whether to add the shadow cell
      * @throws IOException if a remote or network exception occurs
      */
-    public void batch(Transaction transaction, List<? extends Row> rows) throws IOException {
+    public void batch(Transaction transaction, List<? extends Row> rows, boolean addShadowCells) throws IOException {
         List<Mutation> mutations = new ArrayList<>(rows.size());
         for (Row row : rows) {
             if (row instanceof Put) {
-                mutations.add(putInternal(transaction, (Put)row, false));
+                mutations.add(putInternal(transaction, (Put)row, addShadowCells));
             } else if (row instanceof Delete) {
                 Put deleteP = deleteInternal(transaction, (Delete)row);
                 if (!deleteP.isEmpty()) {
@@ -634,6 +640,10 @@ public class TTable implements Closeable {
         addMutations(mutations);
     }
 
+    public void batch(Transaction transaction, List<? extends Row> rows) throws IOException {
+        batch(transaction, rows, false);
+    }
+
     /**
      * Transactional version of {@link Table#delete(List deletes)}
      *