You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by td...@apache.org on 2015/12/01 05:18:38 UTC

[13/19] phoenix git commit: PHOENIX-2441 Addendum to not require transaction manager to be run

PHOENIX-2441 Addendum to not require transaction manager to be run


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 548283e7f47e0a7bc45f90279deacdc1a93f30c9
Parents: b550460
Author: James Taylor <jt...@salesforce.com>
Authored: Tue Nov 24 21:25:25 2015 -0800
Committer: Thomas D'Silva <td...@salesforce.com>
Committed: Mon Nov 30 15:03:35 2015 -0800

----------------------------------------------------------------------
 .../apache/phoenix/tx/TxPointInTimeQueryIT.java | 62 --------------------
 .../phoenix/compile/QueryCompilerTest.java      | 22 ++++++-
 2 files changed, 20 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/548283e7/phoenix-core/src/it/java/org/apache/phoenix/tx/TxPointInTimeQueryIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxPointInTimeQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/tx/TxPointInTimeQueryIT.java
deleted file mode 100644
index a3b3aa2..0000000
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TxPointInTimeQueryIT.java
+++ /dev/null
@@ -1,62 +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.tx;
-
-import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.apache.phoenix.end2end.BaseClientManagedTimeIT;
-import org.apache.phoenix.exception.SQLExceptionCode;
-import org.apache.phoenix.util.PhoenixRuntime;
-import org.apache.phoenix.util.PropertiesUtil;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TxPointInTimeQueryIT extends BaseClientManagedTimeIT {
-
-	protected long ts;
-
-	@Before
-	public void initTable() throws Exception {
-		ts = nextTimestamp();
-	}
-
-	@Test
-	public void testQueryWithSCN() throws Exception {
-		Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-		props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts));
-		try (Connection conn = DriverManager.getConnection(getUrl(), props);) {
-			try {
-				conn.createStatement().execute(
-								"CREATE TABLE t (k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR) TRANSACTIONAL=true");
-				fail();
-			} catch (SQLException e) {
-				assertEquals("Unexpected Exception",
-						SQLExceptionCode.CANNOT_START_TRANSACTION_WITH_SCN_SET
-								.getErrorCode(), e.getErrorCode());
-			}
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/548283e7/phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java b/phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
index 9da1a67..bea222b 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
@@ -2126,7 +2126,25 @@ public class QueryCompilerTest extends BaseConnectionlessQueryTest {
         } catch (SQLException e) {
             assertEquals(SQLExceptionCode.ROWTIMESTAMP_COL_INVALID_TYPE.getErrorCode(), e.getErrorCode());
         }
-        
-        
     }
+
+    @Test
+    public void testQueryWithSCN() throws Exception {
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+        props.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(1000));
+        props.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.TRUE.toString());
+        try (Connection conn = DriverManager.getConnection(getUrl(), props);) {
+            try {
+                conn.createStatement().execute(
+                                "CREATE TABLE t (k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR) TRANSACTIONAL=true");
+                fail();
+            } catch (SQLException e) {
+                assertEquals("Unexpected Exception",
+                        SQLExceptionCode.CANNOT_START_TRANSACTION_WITH_SCN_SET
+                                .getErrorCode(), e.getErrorCode());
+            }
+        }
+    }
+
+
 }