Repository: hbase Updated Branches: refs/heads/branch-1.0 fdf1a0e7a -> bd479e868
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/bd479e86 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bd479e86 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bd479e86 Branch: refs/heads/branch-1.0 Commit: bd479e868388665300c9499ce5bbe2cb34b0b37f Parents: fdf1a0e Author: Ramkrishna <[email protected]> Authored: Thu Jan 29 12:43:06 2015 +0530 Committer: Ramkrishna <[email protected]> Committed: Thu Jan 29 12:43:06 2015 +0530 ---------------------------------------------------------------------- .../IntegrationTestBigLinkedListWithVisibility.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/bd479e86/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) {
