You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2016/09/16 00:06:48 UTC
[1/4] phoenix git commit: PHOENIX-3286 Use regular queue depth
instead of overriding it to zero for tests
Repository: phoenix
Updated Branches:
refs/heads/master 2a223adfb -> 4c8bda151
PHOENIX-3286 Use regular queue depth instead of overriding it to zero for tests
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a4ebcfdd
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a4ebcfdd
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a4ebcfdd
Branch: refs/heads/master
Commit: a4ebcfdd262dcc311f96a80c3dd47290bce2c236
Parents: 2a223ad
Author: James Taylor <ja...@apache.org>
Authored: Thu Sep 15 15:52:06 2016 -0700
Committer: James Taylor <ja...@apache.org>
Committed: Thu Sep 15 15:52:06 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/phoenix/query/QueryServicesTestImpl.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/a4ebcfdd/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java b/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java
index 6ae655c..f2b1519 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/query/QueryServicesTestImpl.java
@@ -33,8 +33,7 @@ import org.apache.phoenix.util.ReadOnlyProps;
*/
public final class QueryServicesTestImpl extends BaseQueryServicesImpl {
- private static final int DEFAULT_THREAD_POOL_SIZE = 20;
- private static final int DEFAULT_QUEUE_SIZE = 0;
+ private static final int DEFAULT_THREAD_POOL_SIZE = 10;
// TODO: setting this down to 5mb causes insufficient memory exceptions. Need to investigate why
private static final int DEFAULT_MAX_MEMORY_PERC = 30; // 30% of heap
private static final int DEFAULT_THREAD_TIMEOUT_MS = 60000*5; //5min
@@ -85,7 +84,6 @@ public final class QueryServicesTestImpl extends BaseQueryServicesImpl {
.setSequenceSaltBuckets(DEFAULT_SEQUENCE_TABLE_SALT_BUCKETS)
.setMinStatsUpdateFrequencyMs(DEFAULT_MIN_STATS_UPDATE_FREQ_MS)
.setThreadPoolSize(DEFAULT_THREAD_POOL_SIZE)
- .setQueueSize(DEFAULT_QUEUE_SIZE)
.setMaxMemoryPerc(DEFAULT_MAX_MEMORY_PERC)
.setThreadTimeoutMs(DEFAULT_THREAD_TIMEOUT_MS)
.setSpoolThresholdBytes(DEFAULT_SPOOL_THRESHOLD_BYTES)
[2/4] phoenix git commit: PHOENIX-3253 Make changes to
BaseHBaseTimeManagedIT tests to support method level parallelization
Posted by ja...@apache.org.
PHOENIX-3253 Make changes to BaseHBaseTimeManagedIT tests to support method level parallelization
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1a3bd43a
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1a3bd43a
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1a3bd43a
Branch: refs/heads/master
Commit: 1a3bd43a595f3ba23db823486f476c31e890b3d2
Parents: a4ebcfd
Author: James Taylor <ja...@apache.org>
Authored: Thu Sep 15 15:57:38 2016 -0700
Committer: James Taylor <ja...@apache.org>
Committed: Thu Sep 15 15:57:38 2016 -0700
----------------------------------------------------------------------
.../phoenix/trace/PhoenixTracingEndToEndIT.java | 27 ++++++++++----------
.../org/apache/phoenix/tx/TransactionIT.java | 5 ++--
2 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a3bd43a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
index 2e21846..d6ca23b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTracingEndToEndIT.java
@@ -44,7 +44,6 @@ import org.apache.htrace.impl.ProbabilitySampler;
import org.apache.phoenix.coprocessor.BaseScannerRegionObserver;
import org.apache.phoenix.jdbc.PhoenixConnection;
import org.apache.phoenix.metrics.Metrics;
-import org.apache.phoenix.query.QueryServicesOptions;
import org.apache.phoenix.trace.TraceReader.SpanInfo;
import org.apache.phoenix.trace.TraceReader.TraceHolder;
import org.junit.After;
@@ -61,8 +60,8 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
private static final Log LOG = LogFactory.getLog(PhoenixTracingEndToEndIT.class);
private static final int MAX_RETRIES = 10;
- private final String table = "ENABLED_FOR_LOGGING";
- private final String index = "ENABALED_FOR_LOGGING_INDEX";
+ private String enabledForLoggingTable;
+ private String enableForLoggingIndex;
private DisableableMetricsWriter sink;
private String tableName;
@@ -74,6 +73,8 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
tableName = generateRandomString();
pWriter.initForTesting(conn, tableName);
sink = new DisableableMetricsWriter(pWriter);
+ enabledForLoggingTable = "ENABLED_FOR_LOGGING_" + generateRandomString();
+ enableForLoggingIndex = "ENABALED_FOR_LOGGING_INDEX" + generateRandomString();
TracingTestUtil.registerSink(sink);
}
@@ -184,7 +185,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
// trace the requests we send
Connection traceable = getTracingConnection();
LOG.debug("Doing dummy the writes to the tracked table");
- String insert = "UPSERT INTO " + table + " VALUES (?, ?)";
+ String insert = "UPSERT INTO " + enabledForLoggingTable + " VALUES (?, ?)";
PreparedStatement stmt = traceable.prepareStatement(insert);
stmt.setString(1, "key1");
stmt.setLong(2, 1);
@@ -222,7 +223,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
public boolean foundTrace(TraceHolder trace, SpanInfo span) {
String traceInfo = trace.toString();
// skip logging traces that are just traces about tracing
- if (traceInfo.contains(QueryServicesOptions.DEFAULT_TRACING_STATS_TABLE_NAME)) {
+ if (traceInfo.contains(tableName)) {
return false;
}
return traceInfo.contains("Completing index");
@@ -235,7 +236,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
private void createTestTable(Connection conn, boolean withIndex) throws SQLException {
// create a dummy table
String ddl =
- "create table if not exists " + table + "(" + "k varchar not null, " + "c1 bigint"
+ "create table if not exists " + enabledForLoggingTable + "(" + "k varchar not null, " + "c1 bigint"
+ " CONSTRAINT pk PRIMARY KEY (k))";
conn.createStatement().execute(ddl);
@@ -244,7 +245,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
return;
}
// create an index on the table - we know indexing has some basic tracing
- ddl = "CREATE INDEX IF NOT EXISTS " + index + " on " + table + " (c1)";
+ ddl = "CREATE INDEX IF NOT EXISTS " + enableForLoggingIndex + " on " + enabledForLoggingTable + " (c1)";
conn.createStatement().execute(ddl);
conn.commit();
}
@@ -264,7 +265,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
// update the table, but don't trace these, to simplify the traces we read
LOG.debug("Doing dummy the writes to the tracked table");
- String insert = "UPSERT INTO " + table + " VALUES (?, ?)";
+ String insert = "UPSERT INTO " + enabledForLoggingTable + " VALUES (?, ?)";
PreparedStatement stmt = conn.prepareStatement(insert);
stmt.setString(1, "key1");
stmt.setLong(2, 1);
@@ -280,7 +281,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
conn.rollback();
// do a scan of the table
- String read = "SELECT * FROM " + table;
+ String read = "SELECT * FROM " + enabledForLoggingTable;
ResultSet results = traceable.createStatement().executeQuery(read);
assertTrue("Didn't get first result", results.next());
assertTrue("Didn't get second result", results.next());
@@ -314,7 +315,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
// update the table, but don't trace these, to simplify the traces we read
LOG.debug("Doing dummy the writes to the tracked table");
- String insert = "UPSERT INTO " + table + " VALUES (?, ?)";
+ String insert = "UPSERT INTO " + enabledForLoggingTable + " VALUES (?, ?)";
PreparedStatement stmt = conn.prepareStatement(insert);
stmt.setString(1, "key1");
stmt.setLong(2, 1);
@@ -330,7 +331,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
conn.rollback();
// do a scan of the table
- String read = "SELECT COUNT(*) FROM " + table;
+ String read = "SELECT COUNT(*) FROM " + enabledForLoggingTable;
ResultSet results = traceable.createStatement().executeQuery(read);
assertTrue("Didn't get count result", results.next());
// make sure we got the expected count
@@ -367,7 +368,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
// update the table, but don't trace these, to simplify the traces we read
LOG.debug("Doing dummy the writes to the tracked table");
- String insert = "UPSERT INTO " + table + " VALUES (?, ?)";
+ String insert = "UPSERT INTO " + enabledForLoggingTable + " VALUES (?, ?)";
PreparedStatement stmt = conn.prepareStatement(insert);
stmt.setString(1, "key1");
stmt.setLong(2, 1);
@@ -383,7 +384,7 @@ public class PhoenixTracingEndToEndIT extends BaseTracingTestIT {
conn.rollback();
// do a scan of the table
- String read = "SELECT * FROM " + table;
+ String read = "SELECT * FROM " + enabledForLoggingTable;
ResultSet results = traceable.createStatement().executeQuery(read);
assertTrue("Didn't get first result", results.next());
assertTrue("Didn't get second result", results.next());
http://git-wip-us.apache.org/repos/asf/phoenix/blob/1a3bd43a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index 3d94eba..cbd1472 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -788,9 +788,10 @@ public class TransactionIT extends BaseHBaseManagedTimeTableReuseIT {
String transTableName = generateRandomString();
String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + transTableName;
String selectSQL = "SELECT * FROM " + fullTableName;
- try (Connection conn1 = DriverManager.getConnection(getUrl());
+ try (Connection conn = DriverManager.getConnection(getUrl());
+ Connection conn1 = DriverManager.getConnection(getUrl());
Connection conn2 = DriverManager.getConnection(getUrl())) {
- createTable(conn1, fullTableName);
+ createTable(conn, fullTableName);
conn1.setAutoCommit(false);
conn2.setAutoCommit(true);
ResultSet rs = conn1.createStatement().executeQuery(selectSQL);
[3/4] phoenix git commit: PHOENIX-3249 Make changes in LocalIndexIT
for method level parallelization in BaseHBaseManagedTimeTableReuseIT
Posted by ja...@apache.org.
PHOENIX-3249 Make changes in LocalIndexIT for method level parallelization in BaseHBaseManagedTimeTableReuseIT
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b0f90048
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b0f90048
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b0f90048
Branch: refs/heads/master
Commit: b0f900488dec92d0eaac8e2576991281e78984f5
Parents: 1a3bd43
Author: James Taylor <ja...@apache.org>
Authored: Thu Sep 15 17:01:27 2016 -0700
Committer: James Taylor <ja...@apache.org>
Committed: Thu Sep 15 17:01:27 2016 -0700
----------------------------------------------------------------------
.../end2end/index/AsyncImmutableIndexIT.java | 114 ----------
.../end2end/index/IndexOnOwnClusterIT.java | 114 ++++++++++
.../phoenix/end2end/index/LocalIndexIT.java | 215 ++-----------------
3 files changed, 129 insertions(+), 314 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/b0f90048/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncImmutableIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncImmutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncImmutableIndexIT.java
deleted file mode 100644
index 8c90b6e..0000000
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncImmutableIndexIT.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.phoenix.end2end.index;
-
-import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.phoenix.end2end.BaseOwnClusterHBaseManagedTimeIT;
-import org.apache.phoenix.end2end.IndexToolIT;
-import org.apache.phoenix.mapreduce.index.IndexTool;
-import org.apache.phoenix.query.QueryServices;
-import org.apache.phoenix.query.QueryServicesOptions;
-import org.apache.phoenix.util.PropertiesUtil;
-import org.apache.phoenix.util.QueryUtil;
-import org.apache.phoenix.util.ReadOnlyProps;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.google.common.collect.Maps;
-
-public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
-
- @BeforeClass
- public static void doSetup() throws Exception {
- Map<String, String> serverProps = Maps.newHashMapWithExpectedSize(1);
- serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB,
- QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
- setUpRealDriver(new ReadOnlyProps(serverProps.entrySet().iterator()),
- ReadOnlyProps.EMPTY_PROPS);
- }
-
- @Test
- public void testDeleteFromImmutable() throws Exception {
- Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
- try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
- conn.createStatement().execute("CREATE TABLE TEST_TABLE (\n" +
- " pk1 VARCHAR NOT NULL,\n" +
- " pk2 VARCHAR NOT NULL,\n" +
- " pk3 VARCHAR\n" +
- " CONSTRAINT PK PRIMARY KEY \n" +
- " (\n" +
- " pk1,\n" +
- " pk2,\n" +
- " pk3\n" +
- " )\n" +
- " ) IMMUTABLE_ROWS=true");
- conn.createStatement().execute("upsert into TEST_TABLE (pk1, pk2, pk3) values ('a', '1', '1')");
- conn.createStatement().execute("upsert into TEST_TABLE (pk1, pk2, pk3) values ('b', '2', '2')");
- conn.commit();
- conn.createStatement().execute("CREATE INDEX TEST_INDEX ON TEST_TABLE (pk3, pk2) ASYNC");
-
- // this delete will be issued at a timestamp later than the above timestamp of the index table
- conn.createStatement().execute("delete from TEST_TABLE where pk1 = 'a'");
- conn.commit();
-
- // run the index MR job
- final IndexTool indexingTool = new IndexTool();
- indexingTool.setConf(new Configuration(getUtility().getConfiguration()));
- final String[] cmdArgs =
- IndexToolIT.getArgValues(null, "TEST_TABLE", "TEST_INDEX", true);
- int status = indexingTool.run(cmdArgs);
- assertEquals(0, status);
-
- // upsert two more rows
- conn.createStatement().execute(
- "upsert into TEST_TABLE (pk1, pk2, pk3) values ('a', '3', '3')");
- conn.createStatement().execute(
- "upsert into TEST_TABLE (pk1, pk2, pk3) values ('b', '4', '4')");
- conn.commit();
-
- // validate that delete markers were issued correctly and only ('a', '1', 'value1') was
- // deleted
- String query = "SELECT pk3 from TEST_TABLE ORDER BY pk3";
- ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
- String expectedPlan =
- "CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER TEST_INDEX\n"
- + " SERVER FILTER BY FIRST KEY ONLY";
- assertEquals("Wrong plan ", expectedPlan, QueryUtil.getExplainPlan(rs));
- rs = conn.createStatement().executeQuery(query);
- assertTrue(rs.next());
- assertEquals("2", rs.getString(1));
- assertTrue(rs.next());
- assertEquals("3", rs.getString(1));
- assertTrue(rs.next());
- assertEquals("4", rs.getString(1));
- assertFalse(rs.next());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/b0f90048/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
new file mode 100644
index 0000000..8c90b6e
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end.index;
+
+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.phoenix.end2end.BaseOwnClusterHBaseManagedTimeIT;
+import org.apache.phoenix.end2end.IndexToolIT;
+import org.apache.phoenix.mapreduce.index.IndexTool;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.google.common.collect.Maps;
+
+public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
+
+ @BeforeClass
+ public static void doSetup() throws Exception {
+ Map<String, String> serverProps = Maps.newHashMapWithExpectedSize(1);
+ serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB,
+ QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
+ setUpRealDriver(new ReadOnlyProps(serverProps.entrySet().iterator()),
+ ReadOnlyProps.EMPTY_PROPS);
+ }
+
+ @Test
+ public void testDeleteFromImmutable() throws Exception {
+ Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+ try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+ conn.createStatement().execute("CREATE TABLE TEST_TABLE (\n" +
+ " pk1 VARCHAR NOT NULL,\n" +
+ " pk2 VARCHAR NOT NULL,\n" +
+ " pk3 VARCHAR\n" +
+ " CONSTRAINT PK PRIMARY KEY \n" +
+ " (\n" +
+ " pk1,\n" +
+ " pk2,\n" +
+ " pk3\n" +
+ " )\n" +
+ " ) IMMUTABLE_ROWS=true");
+ conn.createStatement().execute("upsert into TEST_TABLE (pk1, pk2, pk3) values ('a', '1', '1')");
+ conn.createStatement().execute("upsert into TEST_TABLE (pk1, pk2, pk3) values ('b', '2', '2')");
+ conn.commit();
+ conn.createStatement().execute("CREATE INDEX TEST_INDEX ON TEST_TABLE (pk3, pk2) ASYNC");
+
+ // this delete will be issued at a timestamp later than the above timestamp of the index table
+ conn.createStatement().execute("delete from TEST_TABLE where pk1 = 'a'");
+ conn.commit();
+
+ // run the index MR job
+ final IndexTool indexingTool = new IndexTool();
+ indexingTool.setConf(new Configuration(getUtility().getConfiguration()));
+ final String[] cmdArgs =
+ IndexToolIT.getArgValues(null, "TEST_TABLE", "TEST_INDEX", true);
+ int status = indexingTool.run(cmdArgs);
+ assertEquals(0, status);
+
+ // upsert two more rows
+ conn.createStatement().execute(
+ "upsert into TEST_TABLE (pk1, pk2, pk3) values ('a', '3', '3')");
+ conn.createStatement().execute(
+ "upsert into TEST_TABLE (pk1, pk2, pk3) values ('b', '4', '4')");
+ conn.commit();
+
+ // validate that delete markers were issued correctly and only ('a', '1', 'value1') was
+ // deleted
+ String query = "SELECT pk3 from TEST_TABLE ORDER BY pk3";
+ ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+ String expectedPlan =
+ "CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER TEST_INDEX\n"
+ + " SERVER FILTER BY FIRST KEY ONLY";
+ assertEquals("Wrong plan ", expectedPlan, QueryUtil.getExplainPlan(rs));
+ rs = conn.createStatement().executeQuery(query);
+ assertTrue(rs.next());
+ assertEquals("2", rs.getString(1));
+ assertTrue(rs.next());
+ assertEquals("3", rs.getString(1));
+ assertTrue(rs.next());
+ assertEquals("4", rs.getString(1));
+ assertFalse(rs.next());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/b0f90048/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
index f254c49..d3d775b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
@@ -33,14 +33,10 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.Collection;
-import java.util.List;
-import java.util.Map;
import java.util.Properties;
import org.apache.hadoop.hbase.HColumnDescriptor;
-import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.MetaTableAccessor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
@@ -52,47 +48,41 @@ import org.apache.hadoop.hbase.util.Pair;
import org.apache.phoenix.compile.QueryPlan;
import org.apache.phoenix.coprocessor.BaseScannerRegionObserver;
import org.apache.phoenix.end2end.BaseHBaseManagedTimeTableReuseIT;
-import org.apache.phoenix.end2end.Shadower;
import org.apache.phoenix.hbase.index.IndexRegionSplitPolicy;
import org.apache.phoenix.jdbc.PhoenixConnection;
-import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.apache.phoenix.query.BaseTest;
import org.apache.phoenix.query.QueryConstants;
import org.apache.phoenix.query.QueryServices;
-import org.apache.phoenix.schema.*;
+import org.apache.phoenix.schema.PNameFactory;
+import org.apache.phoenix.schema.PTable;
import org.apache.phoenix.schema.PTable.IndexType;
-import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.schema.PTableKey;
+import org.apache.phoenix.schema.TableNotFoundException;
+import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.QueryUtil;
-import org.apache.phoenix.util.ReadOnlyProps;
import org.apache.phoenix.util.SchemaUtil;
import org.apache.phoenix.util.TestUtil;
-import org.junit.BeforeClass;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import com.google.common.collect.Maps;
-
@RunWith(Parameterized.class)
public class LocalIndexIT extends BaseHBaseManagedTimeTableReuseIT {
private boolean isNamespaceMapped;
- String schemaName="TEST";
+ private String schemaName;
public LocalIndexIT(boolean isNamespaceMapped) {
this.isNamespaceMapped = isNamespaceMapped;
}
- @BeforeClass
- @Shadower(classBeingShadowed = BaseHBaseManagedTimeTableReuseIT.class)
- public static void doSetup() throws Exception {
- Map<String,String> props = Maps.newHashMapWithExpectedSize(3);
- // Drop the HBase table metadata for this test
- props.put(QueryServices.DROP_METADATA_ATTRIB, Boolean.toString(true));
- // Must update config before starting server
- setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+ @Before
+ public void setup() {
+ schemaName = BaseTest.generateRandomString();
}
-
+
private void createBaseTable(String tableName, Integer saltBuckets, String splits) throws SQLException {
Connection conn = getConnection();
if (isNamespaceMapped) {
@@ -110,7 +100,7 @@ public class LocalIndexIT extends BaseHBaseManagedTimeTableReuseIT {
conn.close();
}
- @Parameters(name = "isNamespaceMapped = {0}")
+ @Parameters(name = "LocalIndexIT_isNamespaceMapped={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean> data() {
return Arrays.asList(true, false);
}
@@ -202,14 +192,12 @@ public class LocalIndexIT extends BaseHBaseManagedTimeTableReuseIT {
}
}
- public Connection getConnection() throws SQLException{
- Properties props = new Properties();
- props.put(QueryServices.DROP_METADATA_ATTRIB, Boolean.toString(true));
+ private Connection getConnection() throws SQLException{
+ Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
props.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceMapped));
return DriverManager.getConnection(getUrl(),props);
}
-
@Test
public void testDropLocalIndexTable() throws Exception {
String tableName = schemaName + "." + generateRandomString();
@@ -805,103 +793,6 @@ public class LocalIndexIT extends BaseHBaseManagedTimeTableReuseIT {
}
@Test
- public void testLocalIndexScanAfterRegionSplit() throws Exception {
- String tableName = schemaName + "." + generateRandomString();
- String indexName = "IDX_" + generateRandomString();
- TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
- String indexPhysicalTableName = physicalTableName.getNameAsString();
-
- if (isNamespaceMapped) { return; }
- createBaseTable(tableName, null, "('e','j','o')");
- Connection conn1 = getConnection();
- try{
- String[] strings = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
- for (int i = 0; i < 26; i++) {
- conn1.createStatement().execute(
- "UPSERT INTO " + tableName + " values('"+strings[i]+"'," + i + ","
- + (i + 1) + "," + (i + 2) + ",'" + strings[25 - i] + "')");
- }
- conn1.commit();
- conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)");
- conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "_2 ON " + tableName + "(k3)");
-
- ResultSet rs = conn1.createStatement().executeQuery("SELECT * FROM " + tableName);
- assertTrue(rs.next());
-
- HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
- for (int i = 1; i < 5; i++) {
- admin.split(physicalTableName, ByteUtil.concat(Bytes.toBytes(strings[3*i])));
- List<HRegionInfo> regionsOfUserTable =
- MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
- physicalTableName, false);
-
- while (regionsOfUserTable.size() != (4+i)) {
- Thread.sleep(100);
- regionsOfUserTable = MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
- admin.getConnection(), physicalTableName, false);
- }
- assertEquals(4+i, regionsOfUserTable.size());
- String[] tIdColumnValues = new String[26];
- String[] v1ColumnValues = new String[26];
- int[] k1ColumnValue = new int[26];
- String query = "SELECT t_id,k1,v1 FROM " + tableName;
- rs = conn1.createStatement().executeQuery(query);
- Thread.sleep(1000);
- for (int j = 0; j < 26; j++) {
- assertTrue(rs.next());
- tIdColumnValues[j] = rs.getString("t_id");
- k1ColumnValue[j] = rs.getInt("k1");
- v1ColumnValues[j] = rs.getString("V1");
- }
- Arrays.sort(tIdColumnValues);
- Arrays.sort(v1ColumnValues);
- Arrays.sort(k1ColumnValue);
- assertTrue(Arrays.equals(strings, tIdColumnValues));
- assertTrue(Arrays.equals(strings, v1ColumnValues));
- for(int m=0;m<26;m++) {
- assertEquals(m, k1ColumnValue[m]);
- }
-
- rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
- assertEquals(
- "CLIENT PARALLEL " + (4 + i) + "-WAY RANGE SCAN OVER "
- + indexPhysicalTableName + " [1]\n"
- + " SERVER FILTER BY FIRST KEY ONLY\n"
- + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
-
- query = "SELECT t_id,k1,k3 FROM " + tableName;
- rs = conn1.createStatement().executeQuery("EXPLAIN "+query);
- assertEquals(
- "CLIENT PARALLEL "
- + ((strings[3 * i].compareTo("j") < 0) ? (4 + i) : (4 + i - 1))
- + "-WAY RANGE SCAN OVER "
- + indexPhysicalTableName + " [2]\n"
- + " SERVER FILTER BY FIRST KEY ONLY\n"
- + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
- rs = conn1.createStatement().executeQuery(query);
- Thread.sleep(1000);
- int[] k3ColumnValue = new int[26];
- for (int j = 0; j < 26; j++) {
- assertTrue(rs.next());
- tIdColumnValues[j] = rs.getString("t_id");
- k1ColumnValue[j] = rs.getInt("k1");
- k3ColumnValue[j] = rs.getInt("k3");
- }
- Arrays.sort(tIdColumnValues);
- Arrays.sort(k1ColumnValue);
- Arrays.sort(k3ColumnValue);
- assertTrue(Arrays.equals(strings, tIdColumnValues));
- for(int m=0;m<26;m++) {
- assertEquals(m, k1ColumnValue[m]);
- assertEquals(m+2, k3ColumnValue[m]);
- }
- }
- } finally {
- conn1.close();
- }
- }
-
- @Test
public void testLocalIndexScanWithSmallChunks() throws Exception {
String tableName = schemaName + "." + generateRandomString();
String indexName = "IDX_" + generateRandomString();
@@ -946,80 +837,4 @@ public class LocalIndexIT extends BaseHBaseManagedTimeTableReuseIT {
conn1.close();
}
}
-
- @Test
- public void testLocalIndexScanAfterRegionsMerge() throws Exception {
- String tableName = schemaName + "." + generateRandomString();
- String indexName = "IDX_" + generateRandomString();
- TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
- String indexPhysicalTableName = physicalTableName.getNameAsString();
-
- if (isNamespaceMapped) { return; }
- createBaseTable(tableName, null, "('e','j','o')");
- Connection conn1 = getConnection();
- try{
- String[] strings = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
- for (int i = 0; i < 26; i++) {
- conn1.createStatement().execute(
- "UPSERT INTO " + tableName + " values('"+strings[i]+"'," + i + ","
- + (i + 1) + "," + (i + 2) + ",'" + strings[25 - i] + "')");
- }
- conn1.commit();
- conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)");
- conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "_2 ON " + tableName + "(k3)");
-
- ResultSet rs = conn1.createStatement().executeQuery("SELECT * FROM " + tableName);
- assertTrue(rs.next());
-
- HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
- List<HRegionInfo> regionsOfUserTable =
- MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
- physicalTableName, false);
- admin.mergeRegions(regionsOfUserTable.get(0).getEncodedNameAsBytes(),
- regionsOfUserTable.get(1).getEncodedNameAsBytes(), false);
- regionsOfUserTable =
- MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
- physicalTableName, false);
-
- while (regionsOfUserTable.size() != 3) {
- Thread.sleep(100);
- regionsOfUserTable = MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
- admin.getConnection(), physicalTableName, false);
- }
- String query = "SELECT t_id,k1,v1 FROM " + tableName;
- rs = conn1.createStatement().executeQuery(query);
- Thread.sleep(1000);
- for (int j = 0; j < 26; j++) {
- assertTrue(rs.next());
- assertEquals(strings[25 - j], rs.getString("t_id"));
- assertEquals(25 - j, rs.getInt("k1"));
- assertEquals(strings[j], rs.getString("V1"));
- }
- rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
- assertEquals(
- "CLIENT PARALLEL " + 3 + "-WAY RANGE SCAN OVER "
- + indexPhysicalTableName
- + " [1]\n" + " SERVER FILTER BY FIRST KEY ONLY\n"
- + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
-
- query = "SELECT t_id,k1,k3 FROM " + tableName;
- rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
- assertEquals(
- "CLIENT PARALLEL " + 3 + "-WAY RANGE SCAN OVER "
- + indexPhysicalTableName
- + " [2]\n" + " SERVER FILTER BY FIRST KEY ONLY\n"
- + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
-
- rs = conn1.createStatement().executeQuery(query);
- Thread.sleep(1000);
- for (int j = 0; j < 26; j++) {
- assertTrue(rs.next());
- assertEquals(strings[j], rs.getString("t_id"));
- assertEquals(j, rs.getInt("k1"));
- assertEquals(j + 2, rs.getInt("k3"));
- }
- } finally {
- conn1.close();
- }
- }
}
[4/4] phoenix git commit: PHOENIX-3285 Add test name in Parameters
name since failsafe uses that to form report file name
Posted by ja...@apache.org.
PHOENIX-3285 Add test name in Parameters name since failsafe uses that to form report file name
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4c8bda15
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4c8bda15
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4c8bda15
Branch: refs/heads/master
Commit: 4c8bda1510606148e6d3d5154ed9004098ff239d
Parents: b0f9004
Author: James Taylor <ja...@apache.org>
Authored: Thu Sep 15 17:07:13 2016 -0700
Committer: James Taylor <ja...@apache.org>
Committed: Thu Sep 15 17:07:13 2016 -0700
----------------------------------------------------------------------
.../phoenix/end2end/AlterTableWithViewsIT.java | 2 +-
.../phoenix/end2end/AutoPartitionViewsIT.java | 2 +-
.../apache/phoenix/end2end/CaseStatementIT.java | 2 +-
.../apache/phoenix/end2end/CastAndCoerceIT.java | 2 +-
.../end2end/ClientTimeArithmeticQueryIT.java | 2 +-
.../apache/phoenix/end2end/DerivedTableIT.java | 4 +-
.../apache/phoenix/end2end/DropSchemaIT.java | 2 +-
.../org/apache/phoenix/end2end/GroupByIT.java | 5 +-
.../org/apache/phoenix/end2end/NotQueryIT.java | 2 +-
.../org/apache/phoenix/end2end/ScanQueryIT.java | 2 +-
.../end2end/SequenceBulkAllocationIT.java | 2 +-
.../apache/phoenix/end2end/TenantIdTypeIT.java | 12 +-
.../phoenix/end2end/index/ImmutableIndexIT.java | 4 +-
.../apache/phoenix/end2end/index/IndexIT.java | 5 +-
.../end2end/index/IndexOnOwnClusterIT.java | 218 ++++++++++++++++++-
.../end2end/index/MutableIndexFailureIT.java | 2 +-
.../phoenix/end2end/index/MutableIndexIT.java | 4 +-
.../end2end/index/ReadOnlyIndexFailureIT.java | 2 +-
.../phoenix/end2end/index/ViewIndexIT.java | 2 +-
.../end2end/index/txn/MutableRollbackIT.java | 2 +-
.../phoenix/end2end/index/txn/RollbackIT.java | 2 +-
.../end2end/index/txn/TxWriteFailureIT.java | 2 +-
.../apache/phoenix/execute/PartialCommitIT.java | 5 +-
.../org/apache/phoenix/tx/TxCheckpointIT.java | 5 +-
24 files changed, 248 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
index ae3b977..177a5c7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
@@ -67,7 +67,7 @@ public class AlterTableWithViewsIT extends BaseHBaseManagedTimeTableReuseIT {
this.isMultiTenant = isMultiTenant;
}
- @Parameters(name="multiTenant = {0}")
+ @Parameters(name="AlterTableWithViewsIT_multiTenant={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean> data() {
return Arrays.asList(false, true);
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
index 95ac2cb..f44c083 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
@@ -56,7 +56,7 @@ public class AutoPartitionViewsIT extends BaseHBaseManagedTimeTableReuseIT {
private final String TENANT_SPECIFIC_URL2 = getUrl() + ';' + PhoenixRuntime.TENANT_ID_ATTRIB
+ "=tenant2";
- @Parameters(name = "salted = {0}, multi-tenant = {1}")
+ @Parameters(name = "AutoPartitionViewsIT_salted={0},multi-tenant={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] { { false, false }, { false, true }, { true, false },
{ true, true } });
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java
index bda1273..59b0f41 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java
@@ -58,7 +58,7 @@ public class CaseStatementIT extends BaseQueryIT {
super(indexDDL);
}
- @Parameters(name="{0}")
+ @Parameters(name="CaseStatementIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java
index 8134aba..876c23a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CastAndCoerceIT.java
@@ -47,7 +47,7 @@ public class CastAndCoerceIT extends BaseQueryIT {
super(indexDDL);
}
- @Parameters(name="{0}")
+ @Parameters(name="CastAndCoerceIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java
index 584f2ff..ea4f3ab 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ClientTimeArithmeticQueryIT.java
@@ -64,7 +64,7 @@ public class ClientTimeArithmeticQueryIT extends BaseQueryIT {
super(indexDDL);
}
- @Parameters(name="{0}")
+ @Parameters(name="ClientTimeArithmeticQueryIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java
index 16ad47f..862416b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DerivedTableIT.java
@@ -18,6 +18,7 @@
package org.apache.phoenix.end2end;
+import static org.apache.phoenix.util.TestUtil.ATABLE_NAME;
import static org.apache.phoenix.util.TestUtil.A_VALUE;
import static org.apache.phoenix.util.TestUtil.B_VALUE;
import static org.apache.phoenix.util.TestUtil.C_VALUE;
@@ -32,7 +33,6 @@ import static org.apache.phoenix.util.TestUtil.ROW7;
import static org.apache.phoenix.util.TestUtil.ROW8;
import static org.apache.phoenix.util.TestUtil.ROW9;
import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
-import static org.apache.phoenix.util.TestUtil.ATABLE_NAME;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -85,7 +85,7 @@ public class DerivedTableIT extends BaseClientManagedTimeIT {
}
}
- @Parameters(name="{0}")
+ @Parameters(name="DerivedTableIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
List<Object> testCases = Lists.newArrayList();
testCases.add(new String[][] {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropSchemaIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropSchemaIT.java
index bfaf401..9d59ec7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropSchemaIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DropSchemaIT.java
@@ -65,7 +65,7 @@ public class DropSchemaIT extends BaseClientManagedTimeIT {
this.schema = schema;
}
- @Parameters(name = "schema = {0}")
+ @Parameters(name = "DropSchemaIT_schema={0}") // name is used by failsafe as file name in reports
public static Collection<String> data() {
return Arrays.asList("TEST_SCHEMA", "\"test_schema\"");
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java
index 1b5c275..f0c781f 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByIT.java
@@ -31,7 +31,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.sql.Connection;
-import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -45,8 +44,6 @@ import java.util.Properties;
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.util.PhoenixRuntime;
import org.apache.phoenix.util.PropertiesUtil;
-import org.apache.phoenix.util.ReadOnlyProps;
-import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,7 +61,7 @@ public class GroupByIT extends BaseQueryIT {
super(indexDDL);
}
- @Parameters(name="{0}")
+ @Parameters(name="GroupByIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java
index 6cc0eed..76627be 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NotQueryIT.java
@@ -56,7 +56,7 @@ public class NotQueryIT extends BaseQueryIT {
super(indexDDL);
}
- @Parameters(name="{0}")
+ @Parameters(name="NotQueryIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java
index 063bdab..9b28bad 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ScanQueryIT.java
@@ -61,7 +61,7 @@ import com.google.common.primitives.Floats;
@RunWith(Parameterized.class)
public class ScanQueryIT extends BaseQueryIT {
- @Parameters(name="{0}")
+ @Parameters(name="ScanQueryIT_{index}") // name is used by failsafe as file name in reports
public static Collection<Object> data() {
return QueryIT.data();
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceBulkAllocationIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceBulkAllocationIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceBulkAllocationIT.java
index e7db1ec..7ea3477 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceBulkAllocationIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SequenceBulkAllocationIT.java
@@ -96,7 +96,7 @@ public class SequenceBulkAllocationIT extends BaseClientManagedTimeIT {
}
}
- @Parameters
+ @Parameters(name="SequenceBulkAllocationIT_tenantId={0}") // name is used by failsafe as file name in reports
public static Object[] data() {
return new Object[] {null, "tenant1"};
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
index c7b5716..a3ca355 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantIdTypeIT.java
@@ -22,11 +22,13 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.sql.*;
-import java.util.Properties;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
-import com.google.common.collect.Lists;
+import java.util.Properties;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.schema.SequenceNotFoundException;
@@ -37,6 +39,8 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
+import com.google.common.collect.Lists;
+
@RunWith(Parameterized.class)
public class TenantIdTypeIT extends BaseHBaseManagedTimeTableReuseIT {
@@ -86,7 +90,7 @@ public class TenantIdTypeIT extends BaseHBaseManagedTimeTableReuseIT {
+ "MULTI_TENANT=true";
}
- @Parameters
+ @Parameters( name = "TenantIdTypeIT_datatype={0}" ) // name is used by failsafe as file name in reports
public static Collection<Object[]> data() {
List<Object[]> testCases = Lists.newArrayList();
testCases.add(new Object[] { "INTEGER", "2147483647", "2147483646" });
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
index 0c7a356..ec5267d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
@@ -72,7 +72,6 @@ import com.google.common.collect.Maps;
public class ImmutableIndexIT extends BaseHBaseManagedTimeTableReuseIT {
private final boolean localIndex;
- private final boolean transactional;
private final String tableDDLOptions;
private volatile boolean stopThreads = false;
@@ -83,7 +82,6 @@ public class ImmutableIndexIT extends BaseHBaseManagedTimeTableReuseIT {
public ImmutableIndexIT(boolean localIndex, boolean transactional) {
this.localIndex = localIndex;
- this.transactional = transactional;
StringBuilder optionBuilder = new StringBuilder("IMMUTABLE_ROWS=true");
if (transactional) {
optionBuilder.append(", TRANSACTIONAL=true");
@@ -103,7 +101,7 @@ public class ImmutableIndexIT extends BaseHBaseManagedTimeTableReuseIT {
setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , transactional = {1}")
+ @Parameters(name="ImmutableIndexIT_localIndex={0},transactional={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false }, { false, true },
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
index a5fefe2..f06ac82 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
@@ -55,7 +55,6 @@ import org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory;
import org.apache.phoenix.compile.ColumnResolver;
import org.apache.phoenix.compile.FromCompiler;
import org.apache.phoenix.end2end.BaseHBaseManagedTimeTableReuseIT;
-import org.apache.phoenix.end2end.BaseOwnClusterIT;
import org.apache.phoenix.end2end.Shadower;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -83,7 +82,7 @@ import org.junit.runners.Parameterized.Parameters;
import com.google.common.collect.Maps;
@RunWith(Parameterized.class)
-public class IndexIT extends BaseOwnClusterIT {
+public class IndexIT extends BaseHBaseManagedTimeTableReuseIT {
private final boolean localIndex;
private final boolean transactional;
@@ -114,7 +113,7 @@ public class IndexIT extends BaseOwnClusterIT {
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , mutable = {1} , transactional = {2}")
+ @Parameters(name="IndexIT_localIndex={0},mutable={1},transactional={2}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false, false }, { false, false, true }, { false, true, false }, { false, true, true },
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
index 8c90b6e..4f0da4d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexOnOwnClusterIT.java
@@ -25,24 +25,36 @@ import static org.junit.Assert.assertTrue;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.util.Bytes;
import org.apache.phoenix.end2end.BaseOwnClusterHBaseManagedTimeIT;
import org.apache.phoenix.end2end.IndexToolIT;
+import org.apache.phoenix.jdbc.PhoenixConnection;
import org.apache.phoenix.mapreduce.index.IndexTool;
import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.util.ByteUtil;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.QueryUtil;
import org.apache.phoenix.util.ReadOnlyProps;
+import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.TestUtil;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.common.collect.Maps;
-public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
+public class IndexOnOwnClusterIT extends BaseOwnClusterHBaseManagedTimeIT {
@BeforeClass
public static void doSetup() throws Exception {
@@ -50,9 +62,9 @@ public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB,
QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
setUpRealDriver(new ReadOnlyProps(serverProps.entrySet().iterator()),
- ReadOnlyProps.EMPTY_PROPS);
+ ReadOnlyProps.EMPTY_PROPS);
}
-
+
@Test
public void testDeleteFromImmutable() throws Exception {
Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
@@ -97,7 +109,7 @@ public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
String query = "SELECT pk3 from TEST_TABLE ORDER BY pk3";
ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
String expectedPlan =
- "CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER TEST_INDEX\n"
+ "CLIENT PARALLEL 1-WAY FULL SCAN OVER TEST_INDEX\n"
+ " SERVER FILTER BY FIRST KEY ONLY";
assertEquals("Wrong plan ", expectedPlan, QueryUtil.getExplainPlan(rs));
rs = conn.createStatement().executeQuery(query);
@@ -111,4 +123,202 @@ public class AsyncImmutableIndexIT extends BaseOwnClusterHBaseManagedTimeIT {
}
}
+ private Connection getConnection() throws SQLException{
+ Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
+ props.put(QueryServices.EXPLAIN_ROW_COUNT_ATTRIB,
+ Boolean.FALSE.toString());
+ props.put(QueryServices.EXPLAIN_CHUNK_COUNT_ATTRIB,
+ Boolean.FALSE.toString());
+ props.put(QueryServices.FORCE_ROW_KEY_ORDER_ATTRIB,
+ Boolean.TRUE.toString());
+ return DriverManager.getConnection(getUrl(),props);
+ }
+
+ private void createBaseTable(String tableName, String splits) throws SQLException {
+ Connection conn = getConnection();
+ String ddl = "CREATE TABLE " + tableName + " (t_id VARCHAR NOT NULL,\n" +
+ "k1 INTEGER NOT NULL,\n" +
+ "k2 INTEGER NOT NULL,\n" +
+ "k3 INTEGER,\n" +
+ "v1 VARCHAR,\n" +
+ "CONSTRAINT pk PRIMARY KEY (t_id, k1, k2))\n"
+ + (splits != null ? (" split on " + splits) : "");
+ conn.createStatement().execute(ddl);
+ conn.close();
+ }
+
+ // Moved from LocalIndexIT because it was causing parallel runs to hang
+ @Test
+ public void testLocalIndexScanAfterRegionSplit() throws Exception {
+ String schemaName = generateRandomString();
+ String tableName = schemaName + "." + generateRandomString();
+ String indexName = "IDX_" + generateRandomString();
+ TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), false);
+ String indexPhysicalTableName = physicalTableName.getNameAsString();
+
+ createBaseTable(tableName, "('e','j','o')");
+ Connection conn1 = getConnection();
+ try{
+ String[] strings = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
+ for (int i = 0; i < 26; i++) {
+ conn1.createStatement().execute(
+ "UPSERT INTO " + tableName + " values('"+strings[i]+"'," + i + ","
+ + (i + 1) + "," + (i + 2) + ",'" + strings[25 - i] + "')");
+ }
+ conn1.commit();
+ conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)");
+ conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "_2 ON " + tableName + "(k3)");
+
+ ResultSet rs = conn1.createStatement().executeQuery("SELECT * FROM " + tableName);
+ assertTrue(rs.next());
+
+ HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+ for (int i = 1; i < 5; i++) {
+ admin.split(physicalTableName, ByteUtil.concat(Bytes.toBytes(strings[3*i])));
+ List<HRegionInfo> regionsOfUserTable =
+ MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
+ physicalTableName, false);
+
+ while (regionsOfUserTable.size() != (4+i)) {
+ Thread.sleep(100);
+ regionsOfUserTable = MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
+ admin.getConnection(), physicalTableName, false);
+ }
+ assertEquals(4+i, regionsOfUserTable.size());
+ String[] tIdColumnValues = new String[26];
+ String[] v1ColumnValues = new String[26];
+ int[] k1ColumnValue = new int[26];
+ String query = "SELECT t_id,k1,v1 FROM " + tableName;
+ rs = conn1.createStatement().executeQuery(query);
+ Thread.sleep(1000);
+ for (int j = 0; j < 26; j++) {
+ assertTrue(rs.next());
+ tIdColumnValues[j] = rs.getString("t_id");
+ k1ColumnValue[j] = rs.getInt("k1");
+ v1ColumnValues[j] = rs.getString("V1");
+ }
+ Arrays.sort(tIdColumnValues);
+ Arrays.sort(v1ColumnValues);
+ Arrays.sort(k1ColumnValue);
+ assertTrue(Arrays.equals(strings, tIdColumnValues));
+ assertTrue(Arrays.equals(strings, v1ColumnValues));
+ for(int m=0;m<26;m++) {
+ assertEquals(m, k1ColumnValue[m]);
+ }
+
+ rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
+ assertEquals(
+ "CLIENT PARALLEL " + (4 + i) + "-WAY RANGE SCAN OVER "
+ + indexPhysicalTableName + " [1]\n"
+ + " SERVER FILTER BY FIRST KEY ONLY\n"
+ + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
+
+ query = "SELECT t_id,k1,k3 FROM " + tableName;
+ rs = conn1.createStatement().executeQuery("EXPLAIN "+query);
+ assertEquals(
+ "CLIENT PARALLEL "
+ + ((strings[3 * i].compareTo("j") < 0) ? (4 + i) : (4 + i - 1))
+ + "-WAY RANGE SCAN OVER "
+ + indexPhysicalTableName + " [2]\n"
+ + " SERVER FILTER BY FIRST KEY ONLY\n"
+ + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
+ rs = conn1.createStatement().executeQuery(query);
+ Thread.sleep(1000);
+ int[] k3ColumnValue = new int[26];
+ for (int j = 0; j < 26; j++) {
+ assertTrue(rs.next());
+ tIdColumnValues[j] = rs.getString("t_id");
+ k1ColumnValue[j] = rs.getInt("k1");
+ k3ColumnValue[j] = rs.getInt("k3");
+ }
+ Arrays.sort(tIdColumnValues);
+ Arrays.sort(k1ColumnValue);
+ Arrays.sort(k3ColumnValue);
+ assertTrue(Arrays.equals(strings, tIdColumnValues));
+ for(int m=0;m<26;m++) {
+ assertEquals(m, k1ColumnValue[m]);
+ assertEquals(m+2, k3ColumnValue[m]);
+ }
+ }
+ } finally {
+ conn1.close();
+ }
+ }
+
+ // Moved from LocalIndexIT because it was causing parallel runs to hang
+ @Test
+ public void testLocalIndexScanAfterRegionsMerge() throws Exception {
+ String schemaName = generateRandomString();
+ String tableName = schemaName + "." + generateRandomString();
+ String indexName = "IDX_" + generateRandomString();
+ TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), false);
+ String indexPhysicalTableName = physicalTableName.getNameAsString();
+
+ createBaseTable(tableName, "('e','j','o')");
+ Connection conn1 = getConnection();
+ try{
+ String[] strings = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
+ for (int i = 0; i < 26; i++) {
+ conn1.createStatement().execute(
+ "UPSERT INTO " + tableName + " values('"+strings[i]+"'," + i + ","
+ + (i + 1) + "," + (i + 2) + ",'" + strings[25 - i] + "')");
+ }
+ conn1.commit();
+ conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(v1)");
+ conn1.createStatement().execute("CREATE LOCAL INDEX " + indexName + "_2 ON " + tableName + "(k3)");
+
+ ResultSet rs = conn1.createStatement().executeQuery("SELECT * FROM " + tableName);
+ assertTrue(rs.next());
+
+ HBaseAdmin admin = conn1.unwrap(PhoenixConnection.class).getQueryServices().getAdmin();
+ List<HRegionInfo> regionsOfUserTable =
+ MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
+ physicalTableName, false);
+ admin.mergeRegions(regionsOfUserTable.get(0).getEncodedNameAsBytes(),
+ regionsOfUserTable.get(1).getEncodedNameAsBytes(), false);
+ regionsOfUserTable =
+ MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(), admin.getConnection(),
+ physicalTableName, false);
+
+ while (regionsOfUserTable.size() != 3) {
+ Thread.sleep(100);
+ regionsOfUserTable = MetaTableAccessor.getTableRegions(getUtility().getZooKeeperWatcher(),
+ admin.getConnection(), physicalTableName, false);
+ }
+ String query = "SELECT t_id,k1,v1 FROM " + tableName;
+ rs = conn1.createStatement().executeQuery(query);
+ Thread.sleep(1000);
+ for (int j = 0; j < 26; j++) {
+ assertTrue(rs.next());
+ assertEquals(strings[25 - j], rs.getString("t_id"));
+ assertEquals(25 - j, rs.getInt("k1"));
+ assertEquals(strings[j], rs.getString("V1"));
+ }
+ rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
+ assertEquals(
+ "CLIENT PARALLEL " + 3 + "-WAY RANGE SCAN OVER "
+ + indexPhysicalTableName
+ + " [1]\n" + " SERVER FILTER BY FIRST KEY ONLY\n"
+ + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
+
+ query = "SELECT t_id,k1,k3 FROM " + tableName;
+ rs = conn1.createStatement().executeQuery("EXPLAIN " + query);
+ assertEquals(
+ "CLIENT PARALLEL " + 3 + "-WAY RANGE SCAN OVER "
+ + indexPhysicalTableName
+ + " [2]\n" + " SERVER FILTER BY FIRST KEY ONLY\n"
+ + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs));
+
+ rs = conn1.createStatement().executeQuery(query);
+ Thread.sleep(1000);
+ for (int j = 0; j < 26; j++) {
+ assertTrue(rs.next());
+ assertEquals(strings[j], rs.getString("t_id"));
+ assertEquals(j, rs.getInt("k1"));
+ assertEquals(j + 2, rs.getInt("k3"));
+ }
+ } finally {
+ conn1.close();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
index c68d897..ff74dc8 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java
@@ -115,7 +115,7 @@ public class MutableIndexFailureIT extends BaseOwnClusterHBaseManagedTimeIT {
setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet().iterator()));
}
- @Parameters(name = "transactional = {0}, localIndex = {1}, isNamespaceMapped = {2}")
+ @Parameters(name = "MutableIndexFailureIT_transactional={0},localIndex={1},isNamespaceMapped={2}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] { { false, false, true }, { false, false, false }, { false, true, true },
{ false, true, false }, { true, false, true }, { true, true, true }, { true, false, false },
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 1646538..6dc4657 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -70,11 +70,9 @@ public class MutableIndexIT extends BaseHBaseManagedTimeTableReuseIT {
protected final boolean localIndex;
private final String tableDDLOptions;
- private final boolean transactional;
public MutableIndexIT(boolean localIndex, boolean transactional) {
this.localIndex = localIndex;
- this.transactional = transactional;
StringBuilder optionBuilder = new StringBuilder();
if (transactional) {
optionBuilder.append("TRANSACTIONAL=true");
@@ -92,7 +90,7 @@ public class MutableIndexIT extends BaseHBaseManagedTimeTableReuseIT {
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , transactional = {1}")
+ @Parameters(name="MutableIndexIT_localIndex={0},transactional={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false }, { false, true }, { true, false }, { true, true }
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ReadOnlyIndexFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ReadOnlyIndexFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ReadOnlyIndexFailureIT.java
index a3ad418..1dae126 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ReadOnlyIndexFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ReadOnlyIndexFailureIT.java
@@ -95,7 +95,7 @@ public class ReadOnlyIndexFailureIT extends BaseOwnClusterHBaseManagedTimeIT {
this.fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
}
- @Parameters(name = "localIndex = {0}")
+ @Parameters(name = "ReadOnlyIndexFailureIT_localIndex={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] { { false }, { true } });
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java
index f70397a..a886bca 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java
@@ -48,7 +48,7 @@ import org.junit.runners.Parameterized.Parameters;
public class ViewIndexIT extends BaseHBaseManagedTimeTableReuseIT {
private boolean isNamespaceMapped;
- @Parameters(name = "isNamespaceMapped = {0}")
+ @Parameters(name = "ViewIndexIT_isNamespaceMapped={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean> data() {
return Arrays.asList(true, false);
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
index 9d61247..8562c0a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/MutableRollbackIT.java
@@ -69,7 +69,7 @@ public class MutableRollbackIT extends BaseHBaseManagedTimeTableReuseIT {
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0}")
+ @Parameters(name="MutableRollbackIT_localIndex={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean> data() {
return Arrays.asList(new Boolean[] { false, true});
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
index 963263f..92a69d0 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/RollbackIT.java
@@ -66,7 +66,7 @@ public class RollbackIT extends BaseHBaseManagedTimeTableReuseIT {
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , mutable = {1}")
+ @Parameters(name="RollbackIT_localIndex={0},mutable={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false }, { false, true },
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
index c7364dd..0202128 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/txn/TxWriteFailureIT.java
@@ -86,7 +86,7 @@ public class TxWriteFailureIT extends BaseOwnClusterHBaseManagedTimeIT {
setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , mutable = {1}")
+ @Parameters(name="TxWriteFailureIT_localIndex={0},mutable={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false }, { false, true }, { true, false }, { true, true }
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
index 7ba6889..6758abc 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/execute/PartialCommitIT.java
@@ -67,8 +67,7 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
@RunWith(Parameterized.class)
-// Needs to extend BaseOwnClusterIT (and not BaseOwnClusterHBaseManagedTimeIT since table data
-// is created and populated once in the constructor
+// Needs to extend BaseOwnClusterIT due to installation of FailingRegionObserver coprocessor
public class PartialCommitIT extends BaseOwnClusterIT {
private final String A_SUCESS_TABLE;
@@ -93,7 +92,7 @@ public class PartialCommitIT extends BaseOwnClusterIT {
createTablesWithABitOfData();
}
- @Parameters(name="transactional = {0}")
+ @Parameters(name="PartialCommitIT_transactional={0}") // name is used by failsafe as file name in reports
public static Collection<Boolean> data() {
return Arrays.asList(false, true);
}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/4c8bda15/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
index 9f47a1e..8f877ac 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TxCheckpointIT.java
@@ -41,14 +41,13 @@ import org.apache.phoenix.query.QueryServices;
import org.apache.phoenix.util.PropertiesUtil;
import org.apache.phoenix.util.ReadOnlyProps;
import org.apache.phoenix.util.SchemaUtil;
+import org.apache.tephra.Transaction.VisibilityLevel;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import org.apache.tephra.Transaction.VisibilityLevel;
-
import com.google.common.collect.Maps;
@RunWith(Parameterized.class)
@@ -72,7 +71,7 @@ public class TxCheckpointIT extends BaseHBaseManagedTimeTableReuseIT {
setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
}
- @Parameters(name="localIndex = {0} , mutable = {1}")
+ @Parameters(name="TxCheckpointIT_localIndex={0},mutable={1}") // name is used by failsafe as file name in reports
public static Collection<Boolean[]> data() {
return Arrays.asList(new Boolean[][] {
{ false, false }, { false, true }, { true, false }, { true, true }