PHOENIX-1964 - porting from master

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

Branch: refs/heads/4.4-HBase-1.0
Commit: e409c0e7ae2ae67379e29fced1dee2045be25e15
Parents: 41037dd
Author: cmarcel <cmar...@salesforce.com>
Authored: Wed May 27 13:53:51 2015 -0700
Committer: cmarcel <cmar...@salesforce.com>
Committed: Wed May 27 13:53:51 2015 -0700

----------------------------------------------------------------------
 .../end2end/BaseClientManagedTimeIT.java~HEAD   |   79 +
 ...on) tests from fast unit tests (GabrielReid) |   41 +
 .../end2end/BaseHBaseManagedTimeIT.java~HEAD    |   66 +
 ...on) tests from fast unit tests (GabrielReid) |   41 +
 .../apache/phoenix/end2end/HashJoinIT.java~HEAD | 3818 ++++++++++++++++++
 ...on) tests from fast unit tests (GabrielReid) | 2242 ++++++++++
 .../apache/phoenix/end2end/OrderByIT.java~HEAD  |  515 +++
 ...on) tests from fast unit tests (GabrielReid) |  153 +
 .../end2end/TenantSpecificViewIndexIT.java~HEAD |  197 +
 ...on) tests from fast unit tests (GabrielReid) |   33 +
 phoenix-pherf/config/pherf.properties           |    3 +
 .../org/apache/phoenix/pherf/DataIngestIT.java  |    3 +-
 .../apache/phoenix/pherf/ResultBaseTestIT.java  |   45 +
 .../java/org/apache/phoenix/pherf/Pherf.java    |    7 +-
 .../apache/phoenix/pherf/PherfConstants.java    |   50 +-
 .../phoenix/pherf/loaddata/DataLoader.java      |    2 +-
 .../apache/phoenix/pherf/result/ResultUtil.java |    4 +-
 .../pherf/result/impl/CSVResultHandler.java     |    5 +-
 .../pherf/result/impl/ImageResultHandler.java   |    5 +-
 .../pherf/result/impl/XMLResultHandler.java     |    6 +-
 .../apache/phoenix/pherf/util/ResourceList.java |   26 -
 .../pherf/workload/WorkloadExecutor.java        |    2 +-
 .../phoenix/pherf/ConfigurationParserTest.java  |    2 +-
 .../org/apache/phoenix/pherf/ResourceTest.java  |    8 +-
 .../apache/phoenix/pherf/ResultBaseTest.java    |   44 +
 .../org/apache/phoenix/pherf/ResultTest.java    |    5 +-
 26 files changed, 7353 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
new file mode 100644
index 0000000..1acd5b3
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~HEAD
@@ -0,0 +1,79 @@
+/*
+ * 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.Map;
+
+import javax.annotation.concurrent.NotThreadSafe;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Base class for tests that manage their own time stamps
+ * We need to separate these from tests that rely on hbase to set
+ * timestamps, because we create/destroy the Phoenix tables
+ * between tests and only allow a table time stamp to increase.
+ * Without this separation table deletion/creation would fail.
+ * 
+ * All tests extending this class use the mini cluster that is
+ * different from the mini cluster used by test classes extending 
+ * {@link BaseHBaseManagedTimeIT}.
+ * 
+ * @since 0.1
+ */
+@NotThreadSafe
+@Category(ClientManagedTimeTest.class)
+public abstract class BaseClientManagedTimeIT extends BaseTest {
+    protected static Configuration getTestClusterConfig() {
+        // don't want callers to modify config.
+        return new Configuration(config);
+    }
+    
+    @After
+    public void cleanUpAfterTest() throws Exception {
+        long ts = nextTimestamp();
+        deletePriorTables(ts - 1, getUrl());    
+    }
+    
+    public static Map<String,String> getDefaultProps() {
+        Map<String,String> props = Maps.newHashMapWithExpectedSize(5);
+        // Must update config before starting server
+        props.put(QueryServices.STATS_USE_CURRENT_TIME_ATTRIB, 
Boolean.FALSE.toString());
+        return props;
+    }
+    
+    @BeforeClass
+    public static void doSetup() throws Exception {
+        Map<String,String> props = getDefaultProps();
+        setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+    }
+    
+    @AfterClass
+    public static void doTeardown() throws Exception {
+        dropNonSystemTables();
+    }
+}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid) 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
new file mode 100644
index 0000000..2c5e400
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseClientManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)    
@@ -0,0 +1,41 @@
+/*
+ * 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 org.junit.Before;
+
+/**
+ * 
+ * Base class for tests that manage their own time stamps
+ * We need to separate these from tests that manged the time stamp
+ * themselves, because we create/destroy the Phoenix tables
+ * between tests and only allow a table time stamp to increase.
+ * If we let HBase set the time stamps, then our client time stamps
+ * will usually be smaller than these time stamps and the table
+ * deletion/creation would fail.
+ * 
+ * 
+ * @since 0.1
+ */
+public abstract class BaseClientManagedTimeIT extends BaseConnectedQueryIT {
+    @Before
+    public void doTestSetup() throws Exception {
+        long ts = nextTimestamp();
+        deletePriorTables(ts-1);
+    }
+}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~HEAD
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~HEAD
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~HEAD
new file mode 100644
index 0000000..679f29d
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~HEAD
@@ -0,0 +1,66 @@
+/*
+ * 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 javax.annotation.concurrent.NotThreadSafe;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.phoenix.query.BaseTest;
+import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Base class for tests that let HBase set timestamps.
+ * We need to separate these from tests that rely on clients 
+ * to set timestamps, because we create/destroy the Phoenix tables
+ * between tests and only allow a table time stamp to increase.
+ * Without this separation table deletion/creation would fail.
+ * 
+ * All tests extending this class use the mini cluster that is
+ * different from the mini cluster used by test classes extending 
+ * {@link BaseClientManagedTimeIT}.
+ * 
+ * @since 0.1
+ */
+@NotThreadSafe
+@Category(HBaseManagedTimeTest.class)
+public abstract class BaseHBaseManagedTimeIT extends BaseTest {
+    protected static Configuration getTestClusterConfig() {
+        // don't want callers to modify config.
+        return new Configuration(config);
+    }
+    
+    @BeforeClass
+    public static void doSetup() throws Exception {
+        setUpTestDriver(ReadOnlyProps.EMPTY_PROPS);
+    }
+    
+    @AfterClass
+    public static void doTeardown() throws Exception {
+        dropNonSystemTables();
+    }
+    
+    @After
+    public void cleanUpAfterTest() throws Exception {
+        deletePriorTables(HConstants.LATEST_TIMESTAMP, getUrl());    
+    }
+}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e409c0e7/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid) 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)
new file mode 100644
index 0000000..c00b74c
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseHBaseManagedTimeIT.java~PHOENIX-130
 Separate execution of slow (integration) tests from fast unit tests 
(GabrielReid)     
@@ -0,0 +1,41 @@
+/*
+ * 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 org.apache.hadoop.hbase.HConstants;
+import org.junit.Before;
+
+/**
+ * 
+ * Base class for tests that have HBase manage the time stamps.
+ * We need to separate these from tests that manged the time stamp
+ * themselves, because we create/destroy the Phoenix tables
+ * between tests and only allow a table time stamp to increase.
+ * If we let HBase set the time stamps, then our client time stamps
+ * will usually be smaller than these time stamps and the table
+ * deletion/creation would fail.
+ *
+ * 
+ * @since 0.1
+ */
+public abstract class BaseHBaseManagedTimeIT extends BaseConnectedQueryIT {
+    @Before
+    public void doTestSetup() throws Exception {
+        deletePriorTables(HConstants.LATEST_TIMESTAMP);
+    }
+}

Reply via email to