hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject hbase git commit: HBASE-12893 - IntegrationTestBigLinkedListWithVisibility should use buffered writes (Jingcheng Du)
Date Thu, 29 Jan 2015 07:12:44 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 a2d8b0e52 -> 7b4058a41


HBASE-12893 - IntegrationTestBigLinkedListWithVisibility should use
buffered writes (Jingcheng Du)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7b4058a4
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7b4058a4
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7b4058a4

Branch: refs/heads/branch-1
Commit: 7b4058a41a81501e5a39caca32310b9fa57e3636
Parents: a2d8b0e
Author: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Authored: Thu Jan 29 12:41:30 2015 +0530
Committer: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Committed: Thu Jan 29 12:41:30 2015 +0530

----------------------------------------------------------------------
 .../IntegrationTestBigLinkedListWithVisibility.java    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7b4058a4/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java
index c68ce4d..2514222 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedListWithVisibility.java
@@ -39,6 +39,8 @@ import org.apache.hadoop.hbase.testclassification.IntegrationTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.chaos.factories.MonkeyFactory;
 import org.apache.hadoop.hbase.client.Admin;
+import org.apache.hadoop.hbase.client.BufferedMutator;
+import org.apache.hadoop.hbase.client.BufferedMutatorParams;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HConnection;
@@ -46,7 +48,6 @@ import org.apache.hadoop.hbase.client.HConnectionManager;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.io.hfile.HFile;
 import org.apache.hadoop.hbase.mapreduce.Import;
@@ -171,8 +172,7 @@ public class IntegrationTestBigLinkedListWithVisibility extends IntegrationTestB
     }
 
     static class VisibilityGeneratorMapper extends GeneratorMapper {
-      Table[] tables = new Table[DEFAULT_TABLES_COUNT];
-      Table commonTable = null;
+      BufferedMutator[] tables = new BufferedMutator[DEFAULT_TABLES_COUNT];
 
       @Override
       protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException,
@@ -183,8 +183,9 @@ public class IntegrationTestBigLinkedListWithVisibility extends IntegrationTestB
       @Override
       protected void instantiateHTable() throws IOException {
         for (int i = 0; i < DEFAULT_TABLES_COUNT; i++) {
-          Table table = connection.getTable(getTableName(i));
-          //table.setWriteBufferSize(4 * 1024 * 1024);
+          BufferedMutatorParams params = new BufferedMutatorParams(getTableName(i));
+          params.writeBufferSize(4 * 1024 * 1024);
+          BufferedMutator table = connection.getBufferedMutator(params);
           this.tables[i] = table;
         }
       }
@@ -217,7 +218,7 @@ public class IntegrationTestBigLinkedListWithVisibility extends IntegrationTestB
             }
             visibilityExps = split[j * 2] + OR + split[(j * 2) + 1];
             put.setCellVisibility(new CellVisibility(visibilityExps));
-            tables[j].put(put);
+            tables[j].mutate(put);
             try {
               Thread.sleep(1);
             } catch (InterruptedException e) {


Mime
View raw message