PHOENIX-2025 Phoenix-core's hbase-default.xml prevents HBaseTestingUtility from starting up in client apps (Geoffrey Jacoby)
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/fb44f353 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/fb44f353 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/fb44f353 Branch: refs/heads/json Commit: fb44f35300510670b037f597ee66f709cb4d8dbb Parents: 14d11b1 Author: James Taylor <jamestay...@apache.org> Authored: Wed Jun 17 17:01:34 2015 -0700 Committer: James Taylor <jamestay...@apache.org> Committed: Wed Jun 17 17:13:25 2015 -0700 ---------------------------------------------------------------------- phoenix-core/src/it/resources/hbase-default.xml | 36 -------------------- phoenix-core/src/it/resources/hbase-site.xml | 36 ++++++++++++++++++++ .../phoenix/compile/WhereCompilerTest.java | 10 ++++-- .../phoenix/query/ConnectionlessTest.java | 14 +------- .../src/test/resources/hbase-default.xml | 36 -------------------- 5 files changed, 45 insertions(+), 87 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/fb44f353/phoenix-core/src/it/resources/hbase-default.xml ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/resources/hbase-default.xml b/phoenix-core/src/it/resources/hbase-default.xml deleted file mode 100644 index 691b702..0000000 --- a/phoenix-core/src/it/resources/hbase-default.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> -<!-- -/** - * 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. - */ ---> -<configuration> - <property> - <name>hbase.defaults.for.version.skip</name> - <value>true</value> - <description> - Set to true to skip the 'hbase.defaults.for.version' check. - Setting this to true can be useful in contexts other than - the other side of a maven generation; i.e. running in an - ide. You'll want to set this boolean to true to avoid - seeing the RuntimException complaint: "hbase-default.xml file - seems to be for and old version of HBase (@@@VERSION@@@), this - version is X.X.X-SNAPSHOT" - </description> - </property> -</configuration> http://git-wip-us.apache.org/repos/asf/phoenix/blob/fb44f353/phoenix-core/src/it/resources/hbase-site.xml ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/resources/hbase-site.xml b/phoenix-core/src/it/resources/hbase-site.xml new file mode 100644 index 0000000..691b702 --- /dev/null +++ b/phoenix-core/src/it/resources/hbase-site.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * 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. + */ +--> +<configuration> + <property> + <name>hbase.defaults.for.version.skip</name> + <value>true</value> + <description> + Set to true to skip the 'hbase.defaults.for.version' check. + Setting this to true can be useful in contexts other than + the other side of a maven generation; i.e. running in an + ide. You'll want to set this boolean to true to avoid + seeing the RuntimException complaint: "hbase-default.xml file + seems to be for and old version of HBase (@@@VERSION@@@), this + version is X.X.X-SNAPSHOT" + </description> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/phoenix/blob/fb44f353/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereCompilerTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereCompilerTest.java b/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereCompilerTest.java index 3a012fb..6c040d2 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereCompilerTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereCompilerTest.java @@ -44,6 +44,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.filter.Filter; @@ -943,8 +946,11 @@ public class WhereCompilerTest extends BaseConnectionlessQueryTest { PhoenixPreparedStatement pstmt = newPreparedStatement(pconn, query); QueryPlan plan = pstmt.optimizeQuery(); Scan scan = plan.getContext().getScan(); - assertEquals(QueryServicesOptions.DEFAULT_SCAN_CACHE_SIZE, pstmt.getFetchSize()); - assertEquals(QueryServicesOptions.DEFAULT_SCAN_CACHE_SIZE, scan.getCaching()); + Configuration config = HBaseConfiguration.create(); + int defaultScannerCacheSize = config.getInt(HConstants.HBASE_CLIENT_SCANNER_CACHING, + HConstants.DEFAULT_HBASE_CLIENT_SCANNER_CACHING); + assertEquals(defaultScannerCacheSize, pstmt.getFetchSize()); + assertEquals(defaultScannerCacheSize, scan.getCaching()); } @Test http://git-wip-us.apache.org/repos/asf/phoenix/blob/fb44f353/phoenix-core/src/test/java/org/apache/phoenix/query/ConnectionlessTest.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/ConnectionlessTest.java b/phoenix-core/src/test/java/org/apache/phoenix/query/ConnectionlessTest.java index 2b2841b..732563f 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/query/ConnectionlessTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/query/ConnectionlessTest.java @@ -22,7 +22,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.sql.Connection; import java.sql.Date; @@ -36,14 +35,13 @@ import java.util.Properties; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; -import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData; import org.apache.phoenix.jdbc.PhoenixDriver; +import org.apache.phoenix.schema.SaltingUtil; import org.apache.phoenix.schema.types.PChar; import org.apache.phoenix.schema.types.PDate; import org.apache.phoenix.schema.types.PVarchar; -import org.apache.phoenix.schema.SaltingUtil; import org.apache.phoenix.util.ByteUtil; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.StringUtil; @@ -172,16 +170,6 @@ public class ConnectionlessTest { } @Test - public void testNoConnectionInfo() throws Exception { - try { - DriverManager.getConnection(PhoenixRuntime.JDBC_PROTOCOL); - fail(); - } catch (SQLException e) { - assertEquals(SQLExceptionCode.MALFORMED_CONNECTION_URL.getSQLState(),e.getSQLState()); - } - } - - @Test public void testMultipleConnectionQueryServices() throws Exception { String url1 = getUrl(); String url2 = url1 + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "LongRunningQueries"; http://git-wip-us.apache.org/repos/asf/phoenix/blob/fb44f353/phoenix-core/src/test/resources/hbase-default.xml ---------------------------------------------------------------------- diff --git a/phoenix-core/src/test/resources/hbase-default.xml b/phoenix-core/src/test/resources/hbase-default.xml deleted file mode 100644 index 691b702..0000000 --- a/phoenix-core/src/test/resources/hbase-default.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> -<!-- -/** - * 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. - */ ---> -<configuration> - <property> - <name>hbase.defaults.for.version.skip</name> - <value>true</value> - <description> - Set to true to skip the 'hbase.defaults.for.version' check. - Setting this to true can be useful in contexts other than - the other side of a maven generation; i.e. running in an - ide. You'll want to set this boolean to true to avoid - seeing the RuntimException complaint: "hbase-default.xml file - seems to be for and old version of HBase (@@@VERSION@@@), this - version is X.X.X-SNAPSHOT" - </description> - </property> -</configuration>