Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.ClusterConnection;
import org.apache.hadoop.hbase.client.Connection;
Expand Down Expand Up @@ -74,10 +75,10 @@ public void init() throws Exception {
if (StringUtils.isNotEmpty(hbaseRoot)) {
config.addResource(new Path(getHbaseRoot() + "/conf/hbase-site.xml"));
} else {
config.set("hbase.rootdir", "hdfs://" + host + ":8020/hbase");
throw new RuntimeException("No path to hbase-site specified. Please configure hbaseRoot property.");
}

HBaseAdmin.checkHBaseAvailable(config);
waitHBaseAvailable(config);
connection = ConnectionFactory.createConnection(config);
admin = connection.getAdmin();
if (admin.getClusterStatus().getServersSize() == 0) {
Expand All @@ -90,6 +91,24 @@ public void init() throws Exception {
ReportUtils.stopLevel(report);
}

private void waitHBaseAvailable(Configuration config) throws Exception {
int attemptsLeft = 50;
while (attemptsLeft > 0) {
try {
HBaseAdmin.checkHBaseAvailable(config);
return;
} catch (ZooKeeperConnectionException e) {
Thread.sleep(500);
attemptsLeft--;
ReportUtils.report(report, getClass(), "Zookeep connection issues: " + e.getMessage(), Reporter.WARNING);
} catch (IOException e) {
Thread.sleep(500);
attemptsLeft--;
ReportUtils.report(report, getClass(), "IO issues: " + e.getMessage(), Reporter.WARNING);
}
}
}

@Override
public void close() {
if (admin != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private void prepareLookupTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "sanity", "gpdb" })
@Test(groups = { "hbase" })
public void sanity() throws Exception {

verifyFilterResults(hbaseTable, exTable, "", NO_FILTER, "sanity", false);
Expand All @@ -164,7 +164,7 @@ public void sanity() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void lowerFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" < '00000030'";
Expand All @@ -178,7 +178,7 @@ public void lowerFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void rangeFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" > '00000090' AND \"cf1:q3\" <= '00000103'";
Expand All @@ -192,7 +192,7 @@ public void rangeFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void specificRowFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" = 4";
Expand All @@ -206,7 +206,7 @@ public void specificRowFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void notEqualsFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" != 30";
Expand All @@ -220,7 +220,7 @@ public void notEqualsFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void rowkeyEqualsFilter() throws Exception {

String whereClause = " WHERE recordkey = '00000090'";
Expand All @@ -234,7 +234,7 @@ public void rowkeyEqualsFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void rowkeyRangeFilter() throws Exception {

String whereClause = " WHERE recordkey > '00000090' AND recordkey <= '00000103'";
Expand All @@ -248,7 +248,7 @@ public void rowkeyRangeFilter() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void multipleQualifiersPushdownFilter() throws Exception {

String whereClause = " WHERE recordkey != '00000002' AND \"cf1:q3\" > 6 AND \"cf1:q8\" < 10 AND \"cf1:q9\" > 0";
Expand All @@ -263,7 +263,7 @@ public void multipleQualifiersPushdownFilter() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void partialFilterPushdown() throws Exception {

String whereClause = " WHERE \"cf1:q3\" > 6 AND \"cf1:q7\" = '42'";
Expand All @@ -279,7 +279,7 @@ public void partialFilterPushdown() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void textFilter() throws Exception {

String whereClause = " WHERE \"cf1:q2\" = 'UTF8_計算機用語_00000024'";
Expand All @@ -292,7 +292,7 @@ public void textFilter() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void doubleFilter() throws Exception {

String whereClause = " WHERE \"cf1:q5\" > 91.92 AND \"cf1:q6\" <= 99999999.99";
Expand All @@ -306,7 +306,7 @@ public void doubleFilter() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void orFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" < 10 OR \"cf1:q5\" > 90";
Expand All @@ -323,7 +323,7 @@ public void orFilter() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void mixedFilterPushdownOrAnd() throws Exception {

String whereClause = " WHERE (\"cf1:q3\" < 10 OR \"cf1:q5\" > 90) AND (\"cf1:q3\" > 5 AND \"cf1:q8\" < 30)";
Expand All @@ -344,7 +344,7 @@ public void mixedFilterPushdownOrAnd() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void isNullFilter() throws Exception {

String whereClause = " WHERE \"cf1:q3\" is null";
Expand All @@ -358,7 +358,7 @@ public void isNullFilter() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void differentColumnNames() throws Exception {

exTableNullHBase = TableFactory.getPxfHBaseReadableTable(
Expand All @@ -377,7 +377,7 @@ public void differentColumnNames() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void disableLookupTable() throws Exception {

try {
Expand All @@ -396,7 +396,7 @@ public void disableLookupTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void noLookupTable() throws Exception {

try {
Expand All @@ -415,7 +415,7 @@ public void noLookupTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void removeColumnFromLookupTable() throws Exception {

try {
Expand All @@ -435,7 +435,7 @@ public void removeColumnFromLookupTable() throws Exception {
* @throws Exception if test fails to run
*/
// TODO: pxf_regress shows diff for this test. Should be fixed.
@Test(enabled = false, groups = { "hbase", "features", "gpdb" })
@Test(enabled = false, groups = { "hbase" })
public void recordkeyAsInteger() throws Exception {

// create external table with record key as INTEGER
Expand All @@ -457,7 +457,7 @@ public void recordkeyAsInteger() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void notExistingHBaseTable() throws Exception {

ReadableExternalTable notExistsHBaseTableExtTable = TableFactory.getPxfHBaseReadableTable(
Expand All @@ -474,7 +474,7 @@ public void notExistingHBaseTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void multiRegionsData() throws Exception {

HBaseTable multiDataHBaseTable = new HBaseTable(
Expand Down Expand Up @@ -513,7 +513,7 @@ public void defaultAnalyze() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void longHBaseQualifierNameNoLookupTable() throws Exception {

HBaseTable longQualifiersNamesHBaseTable = new HBaseTable(
Expand Down Expand Up @@ -559,7 +559,7 @@ public void longHBaseQualifierNameNoLookupTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void longHBaseQualifierNameUsingLookupTable() throws Exception {

HBaseTable longQualifiersNamesHBaseTable = new HBaseTable(
Expand Down Expand Up @@ -600,7 +600,7 @@ public void longHBaseQualifierNameUsingLookupTable() throws Exception {
*
* @throws Exception if test fails to run
*/
@Test(groups = { "hbase", "features", "gpdb" })
@Test(groups = { "hbase" })
public void emptyHBaseTable() throws Exception {

HBaseTable emptyTable = new HBaseTable("empty_table", new String[] { "cf1" });
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions automation/src/test/resources/sut/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<hbase>
<class>org.apache.cloudberry.pxf.automation.components.hbase.HBase</class>
<host>localhost</host>
<hbaseRoot>/home/gpadmin/workspace/singlecluster/hbase</hbaseRoot>
</hbase>

<hive>
Expand Down
Loading
Loading