Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 85e455bd1 -> 00e3d29c6
PHOENIX-4255 Breakup StatsCollectorIT into several integration tests to limit number of tables created Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/00e3d29c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/00e3d29c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/00e3d29c Branch: refs/heads/4.x-HBase-0.98 Commit: 00e3d29c6c7b738858558a4f41eecd28dd9c4c88 Parents: 85e455b Author: Samarth Jain <[email protected]> Authored: Thu Sep 28 23:50:20 2017 -0700 Committer: Samarth Jain <[email protected]> Committed: Thu Sep 28 23:50:20 2017 -0700 ---------------------------------------------------------------------- ...mnEncodedImmutableNonTxStatsCollectorIT.java | 38 ++++++++++++++++++++ ...olumnEncodedImmutableTxStatsCollectorIT.java | 38 ++++++++++++++++++++ ...lumnEncodedMutableNonTxStatsCollectorIT.java | 38 ++++++++++++++++++++ .../ColumnEncodedMutableTxStatsCollectorIT.java | 38 ++++++++++++++++++++ ...mnEncodedImmutableNonTxStatsCollectorIT.java | 38 ++++++++++++++++++++ ...olumnEncodedImmutableTxStatsCollectorIT.java | 38 ++++++++++++++++++++ .../phoenix/end2end/StatsCollectorIT.java | 20 ++--------- ...SysTableNamespaceMappedStatsCollectorIT.java | 21 ++++++++--- 8 files changed, 247 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java new file mode 100644 index 0000000..7ef825e --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableNonTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class ColumnEncodedImmutableNonTxStatsCollectorIT extends StatsCollectorIT { + + public ColumnEncodedImmutableNonTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters(name="columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList(new Boolean[][] { + { true, false, false, false }, { true, false, false, true } + }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java new file mode 100644 index 0000000..0c6934b --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedImmutableTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class ColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorIT { + + public ColumnEncodedImmutableTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { true, false, true, false }, { true, false, true, true }, }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableNonTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableNonTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableNonTxStatsCollectorIT.java new file mode 100644 index 0000000..3cd81c7 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableNonTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class ColumnEncodedMutableNonTxStatsCollectorIT extends StatsCollectorIT { + + public ColumnEncodedMutableNonTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { true, true, false, false }, { true, true, false, true } }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java new file mode 100644 index 0000000..e4a2734 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ColumnEncodedMutableTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class ColumnEncodedMutableTxStatsCollectorIT extends StatsCollectorIT { + + public ColumnEncodedMutableTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { true, true, true, false }, { true, true, true, true } }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableNonTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableNonTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableNonTxStatsCollectorIT.java new file mode 100644 index 0000000..792752f --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableNonTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class NonColumnEncodedImmutableNonTxStatsCollectorIT extends StatsCollectorIT { + + public NonColumnEncodedImmutableNonTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { false, false, false, false }, { false, false, false, true } }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java new file mode 100644 index 0000000..8df50cb --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/NonColumnEncodedImmutableTxStatsCollectorIT.java @@ -0,0 +1,38 @@ +/* + * 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; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.runners.Parameterized.Parameters; + +public class NonColumnEncodedImmutableTxStatsCollectorIT extends StatsCollectorIT { + + public NonColumnEncodedImmutableTxStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { + super(mutable, transactional, userTableNamespaceMapped, columnEncoded); + } + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { false, false, true, false }, { false, false, true, true } }); + } +} http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java index 19b5275..da8e78d 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/StatsCollectorIT.java @@ -33,8 +33,6 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.Arrays; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Properties; @@ -71,12 +69,11 @@ import org.junit.Ignore; 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 StatsCollectorIT extends BaseUniqueNamesOwnClusterIT { +public abstract class StatsCollectorIT extends BaseUniqueNamesOwnClusterIT { private final String tableDDLOptions; private final boolean columnEncoded; private String tableName; @@ -86,7 +83,7 @@ public class StatsCollectorIT extends BaseUniqueNamesOwnClusterIT { private final boolean userTableNamespaceMapped; private final boolean mutable; - public StatsCollectorIT(boolean mutable, boolean transactional, boolean userTableNamespaceMapped, boolean columnEncoded) { + protected StatsCollectorIT(boolean mutable, boolean transactional, boolean userTableNamespaceMapped, boolean columnEncoded) { StringBuilder sb = new StringBuilder(); if (transactional) { sb.append("TRANSACTIONAL=true"); @@ -116,18 +113,7 @@ public class StatsCollectorIT extends BaseUniqueNamesOwnClusterIT { this.columnEncoded = columnEncoded; this.mutable = mutable; } - - @Parameters(name="columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") - public static Collection<Boolean[]> data() { - return Arrays.asList(new Boolean[][] { - { false, false, false, false }, { false, false, false, true }, { false, false, true, false }, { false, false, true, true }, - // no need to test non column encoded mutable case and this is the same as non column encoded immutable - //{ false, true, false, false }, { false, true, false, true }, { false, true, true, false }, { false, true, true, true }, - { true, false, false, false }, { true, false, false, true }, { true, false, true, false }, { true, false, true, true }, - { true, true, false, false }, { true, true, false, true }, { true, true, true, false }, { true, true, true, true } - }); - } - + @BeforeClass public static void doSetup() throws Exception { // enable name space mapping at global level on both client and server side http://git-wip-us.apache.org/repos/asf/phoenix/blob/00e3d29c/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java index f9ef0c2..36779c2 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SysTableNamespaceMappedStatsCollectorIT.java @@ -17,20 +17,31 @@ */ package org.apache.phoenix.end2end; +import java.util.Arrays; +import java.util.Collection; import java.util.Map; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.util.ReadOnlyProps; import org.junit.BeforeClass; +import org.junit.runners.Parameterized.Parameters; import com.google.common.collect.Maps; public class SysTableNamespaceMappedStatsCollectorIT extends StatsCollectorIT { - - public SysTableNamespaceMappedStatsCollectorIT(boolean mutable, boolean transactional, boolean userTableNamespaceMapped, boolean columnEncoded) { + + public SysTableNamespaceMappedStatsCollectorIT(boolean mutable, boolean transactional, + boolean userTableNamespaceMapped, boolean columnEncoded) { super(mutable, transactional, userTableNamespaceMapped, columnEncoded); } - + + @Parameters( + name = "columnEncoded = {0}, mutable = {1}, transactional = {2}, isUserTableNamespaceMapped = {3}") + public static Collection<Boolean[]> data() { + return Arrays.asList( + new Boolean[][] { { true, true, false, false }, { true, true, false, true }, }); + } + @BeforeClass public static void doSetup() throws Exception { // enable name space mapping at global level on both client and server side @@ -42,8 +53,8 @@ public class SysTableNamespaceMappedStatsCollectorIT extends StatsCollectorIT { clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, "true"); clientProps.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(20)); clientProps.put(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, "true"); - setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), new ReadOnlyProps(clientProps.entrySet().iterator())); + setUpTestDriver(new ReadOnlyProps(serverProps.entrySet().iterator()), + new ReadOnlyProps(clientProps.entrySet().iterator())); } - }
