Repository: phoenix Updated Branches: refs/heads/3.0 1c6e46ab2 -> 1588b295c
PHOENIX-1677 Immutable index deadlocks when number of guideposts are one half of thread pool size Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1588b295 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1588b295 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1588b295 Branch: refs/heads/3.0 Commit: 1588b295c53c74572c1d05662848e65329ed2f9c Parents: 1c6e46a Author: James Taylor <[email protected]> Authored: Sat Mar 14 14:20:24 2015 -0700 Committer: James Taylor <[email protected]> Committed: Sun Mar 15 00:09:53 2015 -0700 ---------------------------------------------------------------------- .../index/ImmutableIndexWithStatsIT.java | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/1588b295/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java index e5b38f3..867c0f7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java @@ -28,8 +28,7 @@ import java.sql.ResultSet; import java.util.Map; import java.util.Properties; -import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT; -import org.apache.phoenix.end2end.Shadower; +import org.apache.phoenix.end2end.BaseOwnClusterHBaseManagedTimeIT; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.QueryUtil; @@ -41,13 +40,11 @@ import org.junit.Test; import com.google.common.collect.Maps; -public class ImmutableIndexWithStatsIT extends BaseHBaseManagedTimeIT { +public class ImmutableIndexWithStatsIT extends BaseOwnClusterHBaseManagedTimeIT { @BeforeClass - @Shadower(classBeingShadowed = BaseHBaseManagedTimeIT.class) public static void doSetup() throws Exception { Map<String,String> props = Maps.newHashMapWithExpectedSize(5); - props.put(QueryServices.DROP_METADATA_ATTRIB, Boolean.toString(true)); props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(1)); props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB, Boolean.TRUE.toString()); props.put(QueryServices.THREAD_POOL_SIZE_ATTRIB, Integer.toString(4)); @@ -63,12 +60,13 @@ public class ImmutableIndexWithStatsIT extends BaseHBaseManagedTimeIT { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(false); - conn.createStatement().execute("CREATE TABLE " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME + " (k VARCHAR NOT NULL PRIMARY KEY, v VARCHAR) IMMUTABLE_ROWS=TRUE"); - query = "SELECT * FROM " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME; + String tableName = TestUtil.DEFAULT_DATA_TABLE_FULL_NAME; + conn.createStatement().execute("CREATE TABLE " + tableName + " (k VARCHAR NOT NULL PRIMARY KEY, v VARCHAR) IMMUTABLE_ROWS=TRUE"); + query = "SELECT * FROM " + tableName; rs = conn.createStatement().executeQuery(query); assertFalse(rs.next()); - PreparedStatement stmt = conn.prepareStatement("UPSERT INTO " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME + " VALUES(?,?)"); + PreparedStatement stmt = conn.prepareStatement("UPSERT INTO " + tableName + " VALUES(?,?)"); for (int i=0; i<6;i++) { stmt.setString(1,"k" + i); stmt.setString(2, "v" + i ); @@ -76,14 +74,15 @@ public class ImmutableIndexWithStatsIT extends BaseHBaseManagedTimeIT { } conn.commit(); - conn.createStatement().execute("UPDATE STATISTICS " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME); - query = "SELECT COUNT(*) FROM " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME; + conn.createStatement().execute("UPDATE STATISTICS " + tableName); + query = "SELECT COUNT(*) FROM " + tableName; rs = conn.createStatement().executeQuery("EXPLAIN " + query); assertTrue(QueryUtil.getExplainPlan(rs).startsWith("CLIENT 7-CHUNK PARALLEL 1-WAY FULL SCAN")); - conn.createStatement().execute("CREATE INDEX " + TestUtil.DEFAULT_INDEX_TABLE_NAME + " ON " + TestUtil.DEFAULT_DATA_TABLE_FULL_NAME + " (v)"); + String indexName = TestUtil.DEFAULT_INDEX_TABLE_NAME; + conn.createStatement().execute("CREATE INDEX " + indexName + " ON " + tableName + " (v)"); - query = "SELECT * FROM " + TestUtil.DEFAULT_INDEX_TABLE_FULL_NAME; + query = "SELECT * FROM " + indexName; rs = conn.createStatement().executeQuery(query); assertTrue(rs.next()); }
