phoenix git commit: PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping

2018-12-20 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.4 255379d2c -> 46cdaf62c


PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/46cdaf62
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/46cdaf62
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/46cdaf62

Branch: refs/heads/4.x-HBase-1.4
Commit: 46cdaf62c6d6f0c990865f15c70aa717c6efd9aa
Parents: 255379d
Author: Kadir 
Authored: Thu Dec 20 11:38:44 2018 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 20 14:21:12 2018 -0800

--
 .../phoenix/end2end/DropTableWithViewsIT.java   | 56 +++-
 1 file changed, 30 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/46cdaf62/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
index 9502218..a4cd354 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.end2end;
 import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -30,14 +29,16 @@ import java.util.Collection;
 
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.phoenix.coprocessor.TableViewFinderResult;
+import org.apache.phoenix.coprocessor.TaskRegionObserver;
 import org.apache.phoenix.coprocessor.ViewFinder;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.util.SchemaUtil;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -50,6 +51,20 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 private final boolean columnEncoded;
 private final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=" + TENANT1;
 
+private static RegionCoprocessorEnvironment TaskRegionEnvironment;
+
+@BeforeClass
+public static void doSetup() throws Exception {
+SplitSystemCatalogIT.doSetup();
+TaskRegionEnvironment =
+getUtility()
+.getRSForFirstRegionInTable(
+
PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+
.getRegions(PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+.get(0).getCoprocessorHost()
+
.findCoprocessorEnvironment(TaskRegionObserver.class.getName());
+}
+
 public DropTableWithViewsIT(boolean isMultiTenant, boolean columnEncoded) {
 this.isMultiTenant = isMultiTenant;
 this.columnEncoded = columnEncoded;
@@ -108,30 +123,19 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 // Drop the base table
 String dropTable = String.format("DROP TABLE IF EXISTS %s 
CASCADE", baseTable);
 conn.createStatement().execute(dropTable);
-
-// Wait for the tasks for dropping child views to complete. The 
depth of the view tree is 2, so we expect that
-// this will be done in two task handling runs, i.e., in tree task 
handling interval at most in general
-// by assuming that each non-root level will be processed in one 
interval. To be on the safe side, we will
-// wait at most 10 intervals.
-long halfTimeInterval = 
config.getLong(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB,
-QueryServicesOptions.DEFAULT_TASK_HANDLING_INTERVAL_MS)/2;
-ResultSet rs = null;
-boolean timedOut = true;
-Thread.sleep(3 * halfTimeInterval);
-for (int i = 3; i < 20; i++) {
-rs = conn.createStatement().executeQuery("SELECT * " +
-" FROM " + 
PhoenixDatabaseMetaData.SYSTEM_TASK_NAME +
-" WHERE " + PhoenixDatabaseMetaData.TASK_TYPE 
+ " = " +
-
PTable.TaskType.DROP_CHILD_VIEWS.getSerializedValue());
-  

phoenix git commit: PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping

2018-12-20 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 e7ce8e815 -> 43f7687fb


PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/43f7687f
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/43f7687f
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/43f7687f

Branch: refs/heads/4.x-HBase-1.2
Commit: 43f7687fb328ecd19333bbb514fe9672d8b39b9e
Parents: e7ce8e8
Author: Kadir 
Authored: Thu Dec 20 11:38:44 2018 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 20 14:20:56 2018 -0800

--
 .../phoenix/end2end/DropTableWithViewsIT.java   | 56 +++-
 1 file changed, 30 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/43f7687f/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
index 9502218..a4cd354 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.end2end;
 import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -30,14 +29,16 @@ import java.util.Collection;
 
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.phoenix.coprocessor.TableViewFinderResult;
+import org.apache.phoenix.coprocessor.TaskRegionObserver;
 import org.apache.phoenix.coprocessor.ViewFinder;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.util.SchemaUtil;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -50,6 +51,20 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 private final boolean columnEncoded;
 private final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=" + TENANT1;
 
+private static RegionCoprocessorEnvironment TaskRegionEnvironment;
+
+@BeforeClass
+public static void doSetup() throws Exception {
+SplitSystemCatalogIT.doSetup();
+TaskRegionEnvironment =
+getUtility()
+.getRSForFirstRegionInTable(
+
PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+
.getRegions(PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+.get(0).getCoprocessorHost()
+
.findCoprocessorEnvironment(TaskRegionObserver.class.getName());
+}
+
 public DropTableWithViewsIT(boolean isMultiTenant, boolean columnEncoded) {
 this.isMultiTenant = isMultiTenant;
 this.columnEncoded = columnEncoded;
@@ -108,30 +123,19 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 // Drop the base table
 String dropTable = String.format("DROP TABLE IF EXISTS %s 
CASCADE", baseTable);
 conn.createStatement().execute(dropTable);
-
-// Wait for the tasks for dropping child views to complete. The 
depth of the view tree is 2, so we expect that
-// this will be done in two task handling runs, i.e., in tree task 
handling interval at most in general
-// by assuming that each non-root level will be processed in one 
interval. To be on the safe side, we will
-// wait at most 10 intervals.
-long halfTimeInterval = 
config.getLong(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB,
-QueryServicesOptions.DEFAULT_TASK_HANDLING_INTERVAL_MS)/2;
-ResultSet rs = null;
-boolean timedOut = true;
-Thread.sleep(3 * halfTimeInterval);
-for (int i = 3; i < 20; i++) {
-rs = conn.createStatement().executeQuery("SELECT * " +
-" FROM " + 
PhoenixDatabaseMetaData.SYSTEM_TASK_NAME +
-" WHERE " + PhoenixDatabaseMetaData.TASK_TYPE 
+ " = " +
-
PTable.TaskType.DROP_CHILD_VIEWS.getSerializedValue());
-  

phoenix git commit: PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping

2018-12-20 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/master 412e07891 -> 57509506d


PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping


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

Branch: refs/heads/master
Commit: 57509506dd64f67265473ac9daa30d9756e211d6
Parents: 412e078
Author: Kadir 
Authored: Thu Dec 20 11:38:44 2018 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 20 14:20:40 2018 -0800

--
 .../phoenix/end2end/DropTableWithViewsIT.java   | 56 +++-
 1 file changed, 30 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/57509506/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
index 9502218..a4cd354 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.end2end;
 import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -30,14 +29,16 @@ import java.util.Collection;
 
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.phoenix.coprocessor.TableViewFinderResult;
+import org.apache.phoenix.coprocessor.TaskRegionObserver;
 import org.apache.phoenix.coprocessor.ViewFinder;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.util.SchemaUtil;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -50,6 +51,20 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 private final boolean columnEncoded;
 private final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=" + TENANT1;
 
+private static RegionCoprocessorEnvironment TaskRegionEnvironment;
+
+@BeforeClass
+public static void doSetup() throws Exception {
+SplitSystemCatalogIT.doSetup();
+TaskRegionEnvironment =
+getUtility()
+.getRSForFirstRegionInTable(
+
PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+
.getRegions(PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+.get(0).getCoprocessorHost()
+
.findCoprocessorEnvironment(TaskRegionObserver.class.getName());
+}
+
 public DropTableWithViewsIT(boolean isMultiTenant, boolean columnEncoded) {
 this.isMultiTenant = isMultiTenant;
 this.columnEncoded = columnEncoded;
@@ -108,30 +123,19 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 // Drop the base table
 String dropTable = String.format("DROP TABLE IF EXISTS %s 
CASCADE", baseTable);
 conn.createStatement().execute(dropTable);
-
-// Wait for the tasks for dropping child views to complete. The 
depth of the view tree is 2, so we expect that
-// this will be done in two task handling runs, i.e., in tree task 
handling interval at most in general
-// by assuming that each non-root level will be processed in one 
interval. To be on the safe side, we will
-// wait at most 10 intervals.
-long halfTimeInterval = 
config.getLong(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB,
-QueryServicesOptions.DEFAULT_TASK_HANDLING_INTERVAL_MS)/2;
-ResultSet rs = null;
-boolean timedOut = true;
-Thread.sleep(3 * halfTimeInterval);
-for (int i = 3; i < 20; i++) {
-rs = conn.createStatement().executeQuery("SELECT * " +
-" FROM " + 
PhoenixDatabaseMetaData.SYSTEM_TASK_NAME +
-" WHERE " + PhoenixDatabaseMetaData.TASK_TYPE 
+ " = " +
-
PTable.TaskType.DROP_CHILD_VIEWS.getSerializedValue());
-

phoenix git commit: PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping

2018-12-20 Thread tdsilva
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 850114334 -> 214274fc3


PHOENIX-5074 DropTableWithViewsIT.testDropTableWithChildViews is flapping


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/214274fc
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/214274fc
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/214274fc

Branch: refs/heads/4.x-HBase-1.3
Commit: 214274fc3d05db47ad184b0f288e2a6f21d30d1f
Parents: 8501143
Author: Kadir 
Authored: Thu Dec 20 11:38:44 2018 -0800
Committer: Thomas D'Silva 
Committed: Thu Dec 20 14:21:03 2018 -0800

--
 .../phoenix/end2end/DropTableWithViewsIT.java   | 56 +++-
 1 file changed, 30 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/214274fc/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
index 9502218..a4cd354 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
@@ -20,7 +20,6 @@ package org.apache.phoenix.end2end;
 import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -30,14 +29,16 @@ import java.util.Collection;
 
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.phoenix.coprocessor.TableViewFinderResult;
+import org.apache.phoenix.coprocessor.TaskRegionObserver;
 import org.apache.phoenix.coprocessor.ViewFinder;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
 
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.util.SchemaUtil;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -50,6 +51,20 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 private final boolean columnEncoded;
 private final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=" + TENANT1;
 
+private static RegionCoprocessorEnvironment TaskRegionEnvironment;
+
+@BeforeClass
+public static void doSetup() throws Exception {
+SplitSystemCatalogIT.doSetup();
+TaskRegionEnvironment =
+getUtility()
+.getRSForFirstRegionInTable(
+
PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+
.getRegions(PhoenixDatabaseMetaData.SYSTEM_TASK_HBASE_TABLE_NAME)
+.get(0).getCoprocessorHost()
+
.findCoprocessorEnvironment(TaskRegionObserver.class.getName());
+}
+
 public DropTableWithViewsIT(boolean isMultiTenant, boolean columnEncoded) {
 this.isMultiTenant = isMultiTenant;
 this.columnEncoded = columnEncoded;
@@ -108,30 +123,19 @@ public class DropTableWithViewsIT extends 
SplitSystemCatalogIT {
 // Drop the base table
 String dropTable = String.format("DROP TABLE IF EXISTS %s 
CASCADE", baseTable);
 conn.createStatement().execute(dropTable);
-
-// Wait for the tasks for dropping child views to complete. The 
depth of the view tree is 2, so we expect that
-// this will be done in two task handling runs, i.e., in tree task 
handling interval at most in general
-// by assuming that each non-root level will be processed in one 
interval. To be on the safe side, we will
-// wait at most 10 intervals.
-long halfTimeInterval = 
config.getLong(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB,
-QueryServicesOptions.DEFAULT_TASK_HANDLING_INTERVAL_MS)/2;
-ResultSet rs = null;
-boolean timedOut = true;
-Thread.sleep(3 * halfTimeInterval);
-for (int i = 3; i < 20; i++) {
-rs = conn.createStatement().executeQuery("SELECT * " +
-" FROM " + 
PhoenixDatabaseMetaData.SYSTEM_TASK_NAME +
-" WHERE " + PhoenixDatabaseMetaData.TASK_TYPE 
+ " = " +
-
PTable.TaskType.DROP_CHILD_VIEWS.getSerializedValue());
-