You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/06/16 15:11:12 UTC

[GitHub] [hbase] Apache9 opened a new pull request, #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Apache9 opened a new pull request, #4542:
URL: https://github.com/apache/hbase/pull/4542

   …nd also how to make use of the new TestingHBaseCluster


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] Apache9 commented on a diff in pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
Apache9 commented on code in PR #4542:
URL: https://github.com/apache/hbase/pull/4542#discussion_r905711890


##########
src/main/asciidoc/_chapters/unit_testing.adoc:
##########
@@ -321,11 +324,68 @@ public class MyHBaseIntegrationTest {
 }
 ----
 
+Starting from HBase 2.5.0, it is recommended to use TestingHBaseCluster instead.
+
+[source,java]
+----
+public class MyHBaseIntegrationTest {
+
+  private TestingHBaseCluster cluster;
+
+  private Connection conn;
+
+  private Admin admin;
+
+  private TableName tableName = TableName.valueOf("MyTest");
+
+  byte[] CF = "CF".getBytes();
+  byte[] CQ1 = "CQ-1".getBytes();
+  byte[] CQ2 = "CQ-2".getBytes();
+
+  @Before
+  public void setUp() throws Exception {
+    cluster = TestingHBaseCluster.create(TestingHBaseClusterOption.builder().build());
+    cluster.start();
+    conn = ConnectionFactory.createConnection(cluster.getConf());
+    admin = conn.getAdmin();
+    admin.createTable(TableDescriptorBuilder.newBuilder(tableName)
+      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(CF)).build());
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    admin.close();
+    conn.close();
+    cluster.stop();
+  }
+
+  @Test
+  public void testInsert() throws Exception {
+    try (Table table = conn.getTable(tableName)) {
+      HBaseTestObj obj = new HBaseTestObj();
+      obj.setRowKey("ROWKEY-1");
+      obj.setData1("DATA-1");
+      obj.setData2("DATA-2");
+      MyHBaseDAO.insertRecord(table, obj);
+      Get get1 = new Get(Bytes.toBytes(obj.getRowKey()));
+      get1.addColumn(CF, CQ1);
+      Result result1 = table.get(get1);
+      assertEquals(Bytes.toString(result1.getRow()), obj.getRowKey());
+      assertEquals(Bytes.toString(result1.value()), obj.getData1());
+      Get get2 = new Get(Bytes.toBytes(obj.getRowKey()));
+      get2.addColumn(CF, CQ2);
+      Result result2 = table.get(get2);
+      assertEquals(Bytes.toString(result2.getRow()), obj.getRowKey());
+      assertEquals(Bytes.toString(result2.value()), obj.getData2());
+    }
+  }
+}
+----
+
 This code creates an HBase mini-cluster and starts it.
 Next, it creates a table called `MyTest` with one column family, `CF`.
 A record is inserted, a Get is performed from the same table, and the insertion is verified.
 
 NOTE: Starting the mini-cluster takes about 20-30 seconds, but that should be appropriate for integration testing.
 
-See the paper at link:http://blog.sematext.com/2010/08/30/hbase-case-study-using-hbasetestingutility-for-local-testing-development/[HBase Case-Study: Using HBaseTestingUtility for Local Testing and

Review Comment:
   Let's keep it there as our ref guide should contain the information for all the versions. We can remove it later after 2.4.x has been EOL for enough time. Thanks for checking this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] Apache-HBase commented on pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4542:
URL: https://github.com/apache/hbase/pull/4542#issuecomment-1157882712

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 37s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  2s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ master Compile Tests _ |
   ||| _ Patch Compile Tests _ |
   ||| _ Other Tests _ |
   |  |   |   1m 56s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4542 |
   | Optional Tests |  |
   | uname | Linux 04cce560ac68 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / b365748485 |
   | Max. process+thread count | 33 (vs. ulimit of 30000) |
   | modules | C: . U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/console |
   | versions | git=2.17.1 maven=3.6.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] bbeaudreault commented on a diff in pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
bbeaudreault commented on code in PR #4542:
URL: https://github.com/apache/hbase/pull/4542#discussion_r904369878


##########
src/main/asciidoc/_chapters/unit_testing.adoc:
##########
@@ -321,11 +324,68 @@ public class MyHBaseIntegrationTest {
 }
 ----
 
+Starting from HBase 2.5.0, it is recommended to use TestingHBaseCluster instead.
+
+[source,java]
+----
+public class MyHBaseIntegrationTest {
+
+  private TestingHBaseCluster cluster;
+
+  private Connection conn;
+
+  private Admin admin;
+
+  private TableName tableName = TableName.valueOf("MyTest");
+
+  byte[] CF = "CF".getBytes();
+  byte[] CQ1 = "CQ-1".getBytes();
+  byte[] CQ2 = "CQ-2".getBytes();
+
+  @Before
+  public void setUp() throws Exception {
+    cluster = TestingHBaseCluster.create(TestingHBaseClusterOption.builder().build());
+    cluster.start();
+    conn = ConnectionFactory.createConnection(cluster.getConf());
+    admin = conn.getAdmin();
+    admin.createTable(TableDescriptorBuilder.newBuilder(tableName)
+      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(CF)).build());
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    admin.close();
+    conn.close();
+    cluster.stop();
+  }
+
+  @Test
+  public void testInsert() throws Exception {
+    try (Table table = conn.getTable(tableName)) {
+      HBaseTestObj obj = new HBaseTestObj();
+      obj.setRowKey("ROWKEY-1");
+      obj.setData1("DATA-1");
+      obj.setData2("DATA-2");
+      MyHBaseDAO.insertRecord(table, obj);
+      Get get1 = new Get(Bytes.toBytes(obj.getRowKey()));
+      get1.addColumn(CF, CQ1);
+      Result result1 = table.get(get1);
+      assertEquals(Bytes.toString(result1.getRow()), obj.getRowKey());
+      assertEquals(Bytes.toString(result1.value()), obj.getData1());
+      Get get2 = new Get(Bytes.toBytes(obj.getRowKey()));
+      get2.addColumn(CF, CQ2);
+      Result result2 = table.get(get2);
+      assertEquals(Bytes.toString(result2.getRow()), obj.getRowKey());
+      assertEquals(Bytes.toString(result2.value()), obj.getData2());
+    }
+  }
+}
+----
+
 This code creates an HBase mini-cluster and starts it.
 Next, it creates a table called `MyTest` with one column family, `CF`.
 A record is inserted, a Get is performed from the same table, and the insertion is verified.
 
 NOTE: Starting the mini-cluster takes about 20-30 seconds, but that should be appropriate for integration testing.
 
-See the paper at link:http://blog.sematext.com/2010/08/30/hbase-case-study-using-hbasetestingutility-for-local-testing-development/[HBase Case-Study: Using HBaseTestingUtility for Local Testing and

Review Comment:
   Should we just remove this now?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] Apache-HBase commented on pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4542:
URL: https://github.com/apache/hbase/pull/4542#issuecomment-1157896964

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 18s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 36s |  master passed  |
   | +0 :ok: |  refguide  |   2m 43s |  branch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.  |
   | +1 :green_heart: |  spotless  |   0m 46s |  branch has no errors when running spotless:check.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 10s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +0 :ok: |  refguide  |   2m  7s |  patch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.  |
   | +1 :green_heart: |  spotless  |   0m 41s |  patch has no errors when running spotless:check.  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 13s |  The patch does not generate ASF License warnings.  |
   |  |   |  13m 35s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4542 |
   | Optional Tests | dupname asflicense refguide spotless |
   | uname | Linux 326dc19b0886 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / b365748485 |
   | refguide | https://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-4542/1/yetus-general-check/output/branch-site/book.html |
   | refguide | https://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-4542/1/yetus-general-check/output/patch-site/book.html |
   | Max. process+thread count | 64 (vs. ulimit of 30000) |
   | modules | C: . U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/console |
   | versions | git=2.17.1 maven=3.6.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] Apache9 merged pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
Apache9 merged PR #4542:
URL: https://github.com/apache/hbase/pull/4542


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hbase] Apache-HBase commented on pull request #4542: HBASE-26095 Modify our ref guide to mention the deprecation of HBTU a…

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4542:
URL: https://github.com/apache/hbase/pull/4542#issuecomment-1157881674

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 37s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ master Compile Tests _ |
   ||| _ Patch Compile Tests _ |
   ||| _ Other Tests _ |
   |  |   |   1m 40s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4542 |
   | Optional Tests |  |
   | uname | Linux 55d5800f63ec 5.4.0-1043-aws #45~18.04.1-Ubuntu SMP Fri Apr 9 23:32:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / b365748485 |
   | Max. process+thread count | 42 (vs. ulimit of 30000) |
   | modules | C: . U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4542/1/console |
   | versions | git=2.17.1 maven=3.6.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org