Apache-Phoenix | 4.x | HBase 1.6 | Build #55 ABORTED
4.x branch HBase 1.6 build #55 status ABORTED Build #55 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/55/
Apache-Phoenix | 4.x | HBase 1.4 | Build #55 ABORTED
4.x branch HBase 1.4 build #55 status ABORTED Build #55 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/55/
Apache-Phoenix | 4.x | HBase 1.3 | Build #55 ABORTED
4.x branch HBase 1.3 build #55 status ABORTED Build #55 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/55/
Apache-Phoenix | 4.x | HBase 1.4 | Build #54 FAILURE
4.x branch HBase 1.4 build #54 status FAILURE Build #54 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/54/
Apache-Phoenix | master | HBase 2.2 | Build #68 FAILURE
master branch HBase 2.2 build #68 status FAILURE Build #68 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/68/
Apache-Phoenix | 4.x | HBase 1.6 | Build #54 FAILURE
4.x branch HBase 1.6 build #54 status FAILURE Build #54 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/54/
Apache-Phoenix | 4.x | HBase 1.3 | Build #54 FAILURE
4.x branch HBase 1.3 build #54 status FAILURE Build #54 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/54/
Apache-Phoenix | master | HBase 2.1 | Build #68 FAILURE
master branch HBase 2.1 build #68 status FAILURE Build #68 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/68/
Apache-Phoenix | master | HBase 2.3 | Build #68 FAILURE
master branch HBase 2.3 build #68 status FAILURE Build #68 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/68/
[phoenix] branch 4.x updated: PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919)
This is an automated email from the ASF dual-hosted git repository. gjacoby pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.x by this push: new 2359f54 PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919) 2359f54 is described below commit 2359f54944dbdcedf16825370626e49c0cd99fc6 Author: Viraj Jasani AuthorDate: Fri Oct 16 23:54:06 2020 +0530 PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919) PHOENIX-6185 : Propagate info available in SQLExceptionInfo to OPERATION_TIMED_OUT --- .../end2end/OperationTimeoutWithReasonIT.java | 98 ++ .../apache/phoenix/exception/SQLExceptionCode.java | 8 +- .../apache/phoenix/util/SQLExceptionCodeTest.java | 58 + 3 files changed, 162 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java new file mode 100644 index 000..a78d5ac --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java @@ -0,0 +1,98 @@ +/* + * 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.phoenix.util.EnvironmentEdge; +import org.apache.phoenix.util.EnvironmentEdgeManager; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.apache.phoenix.exception.SQLExceptionCode.OPERATION_TIMED_OUT; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class OperationTimeoutWithReasonIT extends ParallelStatsDisabledIT { + +private static final class MyClock extends EnvironmentEdge { +private long time; +private final long delay; + +public MyClock (long time, long delay) { +this.time = time; +this.delay = delay; +} + +@Override +public long currentTime() { +long currentTime = this.time; +this.time += this.delay; +return currentTime; +} +} + +@Test +public void testOperationTimeout() throws SQLException { +final String tableName = generateUniqueName(); +final String ddl = "CREATE TABLE " + tableName ++ " (COL1 VARCHAR NOT NULL PRIMARY KEY, COL2 VARCHAR)"; +try (Connection conn = DriverManager.getConnection(getUrl()); + Statement stmt = conn.createStatement()) { +stmt.execute(ddl); +final String dml = String.format("UPSERT INTO %s VALUES (?, ?)", +tableName); +try(PreparedStatement prepStmt = conn.prepareStatement(dml)) { +for (int i = 1; i <= 100; i++) { +prepStmt.setString(1, "key" + i); +prepStmt.setString(2, "value" + i); +prepStmt.executeUpdate(); +} +} +conn.commit(); +} + +try (Connection conn = DriverManager.getConnection(getUrl()); + Statement stmt = conn.createStatement()) { +stmt.setQueryTimeout(5); // 5 sec +ResultSet rs = stmt.executeQuery(String.format("SELECT * FROM %s", +tableName)); +// Use custom EnvironmentEdge to timeout query with a longer delay in ms +MyClock clock = new MyClock(10, 1); +EnvironmentEdgeManager.injectEdge(clock); +try { +rs.next(); +fail(); +} catch (SQLException e) { +assertEquals(OPERATION_TIMED_OUT.getErrorCode(), +e.getErrorCode()); +assertTrue(e.getMessage().contains("Query couldn't be " + +"completed in the allotted time: 5000 ms")); +} +} finally { +
[phoenix] branch master updated: PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919)
This is an automated email from the ASF dual-hosted git repository. gjacoby pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/master by this push: new 1784848 PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919) 1784848 is described below commit 178484853f82c7556946ad954d9b146f2882399e Author: Viraj Jasani AuthorDate: Fri Oct 16 23:54:06 2020 +0530 PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException (#919) PHOENIX-6185 : Propagate info available in SQLExceptionInfo to OPERATION_TIMED_OUT --- .../end2end/OperationTimeoutWithReasonIT.java | 98 ++ .../apache/phoenix/exception/SQLExceptionCode.java | 8 +- .../apache/phoenix/util/SQLExceptionCodeTest.java | 58 + 3 files changed, 162 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java new file mode 100644 index 000..a78d5ac --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/OperationTimeoutWithReasonIT.java @@ -0,0 +1,98 @@ +/* + * 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.phoenix.util.EnvironmentEdge; +import org.apache.phoenix.util.EnvironmentEdgeManager; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.apache.phoenix.exception.SQLExceptionCode.OPERATION_TIMED_OUT; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class OperationTimeoutWithReasonIT extends ParallelStatsDisabledIT { + +private static final class MyClock extends EnvironmentEdge { +private long time; +private final long delay; + +public MyClock (long time, long delay) { +this.time = time; +this.delay = delay; +} + +@Override +public long currentTime() { +long currentTime = this.time; +this.time += this.delay; +return currentTime; +} +} + +@Test +public void testOperationTimeout() throws SQLException { +final String tableName = generateUniqueName(); +final String ddl = "CREATE TABLE " + tableName ++ " (COL1 VARCHAR NOT NULL PRIMARY KEY, COL2 VARCHAR)"; +try (Connection conn = DriverManager.getConnection(getUrl()); + Statement stmt = conn.createStatement()) { +stmt.execute(ddl); +final String dml = String.format("UPSERT INTO %s VALUES (?, ?)", +tableName); +try(PreparedStatement prepStmt = conn.prepareStatement(dml)) { +for (int i = 1; i <= 100; i++) { +prepStmt.setString(1, "key" + i); +prepStmt.setString(2, "value" + i); +prepStmt.executeUpdate(); +} +} +conn.commit(); +} + +try (Connection conn = DriverManager.getConnection(getUrl()); + Statement stmt = conn.createStatement()) { +stmt.setQueryTimeout(5); // 5 sec +ResultSet rs = stmt.executeQuery(String.format("SELECT * FROM %s", +tableName)); +// Use custom EnvironmentEdge to timeout query with a longer delay in ms +MyClock clock = new MyClock(10, 1); +EnvironmentEdgeManager.injectEdge(clock); +try { +rs.next(); +fail(); +} catch (SQLException e) { +assertEquals(OPERATION_TIMED_OUT.getErrorCode(), +e.getErrorCode()); +assertTrue(e.getMessage().contains("Query couldn't be " + +"completed in the allotted time: 5000 ms")); +} +} finally { +