diff --git a/docs/_docs/SQL/JDBC/jdbc-driver.adoc b/docs/_docs/SQL/JDBC/jdbc-driver.adoc index 40a0d022cdf50..207ab57b1a2db 100644 --- a/docs/_docs/SQL/JDBC/jdbc-driver.adoc +++ b/docs/_docs/SQL/JDBC/jdbc-driver.adoc @@ -162,7 +162,6 @@ For the list of security parameters, refer to the <> section. - `jdbc:ignite:thin://myHost:11900;user=ignite;password=ignite` - connect to myHost on custom port 11900 with user credentials for authentication. - `jdbc:ignite:thin://myHost:11900;distributedJoins=true&autoCloseServerCursor=true` - connect to myHost on custom port 11900 with enabled distributed joins and autoCloseServerCursor optimization. - `jdbc:ignite:thin://myHost:11900/myschema;` - connect to myHost on custom port 11900 and access to MYSCHEMA. -- `jdbc:ignite:thin://myHost:11900/"MySchema";lazy=false` - connect to myHost on custom port 11900 with disabled lazy query execution and access to MySchema (schema name is case sensitive). === Multiple Endpoints @@ -676,21 +675,3 @@ The table below lists all the link:https://en.wikipedia.org/wiki/SQLSTATE[ANSI S |50000| Internal error. The code is not defined by ANSI and refers to an Ignite specific error. Refer to the `java.sql.SQLException` error message for more information. |======================================================================= - - - - - - - - - - - - - - - - - - diff --git a/docs/_docs/SQL/sql-tuning.adoc b/docs/_docs/SQL/sql-tuning.adoc index 35872e8045fbb..0d0b2fbc63eff 100644 --- a/docs/_docs/SQL/sql-tuning.adoc +++ b/docs/_docs/SQL/sql-tuning.adoc @@ -52,43 +52,10 @@ Avoid having too many columns in the result set of a `SELECT` query. Due to limi == Lazy Loading -By default, Ignite attempts to load the whole result set to memory and send it back to the query initiator (which is usually your application). -This approach provides optimal performance for queries of small or medium result sets. -However, if the result set is too big to fit in the available memory, it can lead to prolonged GC pauses and even `OutOfMemoryError` exceptions. - -To minimize memory consumption, at the cost of a moderate performance hit, you can load and process the result sets lazily by passing the `lazy` parameter to the JDBC and ODBC connection strings or use a similar method available for Java, .NET, and C++ APIs: - -[tabs] --- - -tab:Java[] -[source,java] ----- -SqlFieldsQuery query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10"); - -// Result set will be loaded lazily. -query.setLazy(true); ----- -tab:JDBC[] -[source,sql] ----- -jdbc:ignite:thin://192.168.0.15?lazy=true ----- -tab:C#/.NET[] -[source,csharp] ----- -var query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10") -{ - // Result set will be loaded lazily. - Lazy = true -}; ----- -tab:C++[] --- - -//// -*TODO* Add tabs for ODBC and other programming languages - C# and C++ -//// +Ignite always operates in lazy loading mode. Query results are not loaded entirely into memory — data is streamed to +the client in pages as the result set is iterated. The page size determines how many rows are fetched per network round +trip, allowing you to balance memory consumption and performance and eliminating the risk of prolonged GC pauses +and `OutOfMemoryError` exceptions for large result sets. == Querying Colocated Data diff --git a/docs/_docs/binary-client-protocol/sql-and-scan-queries.adoc b/docs/_docs/binary-client-protocol/sql-and-scan-queries.adoc index 168b5aaca4731..f3a25bb5dde4c 100644 --- a/docs/_docs/binary-client-protocol/sql-and-scan-queries.adoc +++ b/docs/_docs/binary-client-protocol/sql-and-scan-queries.adoc @@ -267,7 +267,6 @@ UPDATE = 2 |bool| Replicated only - Whether query contains only replicated tables or not. |bool| Enforce join order. |bool| Collocated - Whether your data is co-located or not. -|bool| Lazy query execution. |long| Timeout (milliseconds). |bool| Include field names. |=== @@ -355,7 +354,7 @@ out.writeBoolean(false); out.writeBoolean(false); // Lazy -out.writeBoolean(false); +out.writeBoolean(true); // Timeout writeLongLittleEndian(5000, out); @@ -631,4 +630,3 @@ readResponseHeader(in); ---- -- - diff --git a/docs/_docs/perf-and-troubleshooting/sql-tuning.adoc b/docs/_docs/perf-and-troubleshooting/sql-tuning.adoc index 3f1610555c92f..b71d0d9b9e742 100644 --- a/docs/_docs/perf-and-troubleshooting/sql-tuning.adoc +++ b/docs/_docs/perf-and-troubleshooting/sql-tuning.adoc @@ -78,45 +78,10 @@ with 100+ columns may perform worse than expected. == Lazy Loading -By default, Ignite will set Lazy Loading enabled, this will minimize memory consumption at the cost of moderate performance degradation. - -Otherwise, Ignite attempts to load the whole result set to memory and send it back to the query initiator (which is usually your application). This approach provides optimal performance for queries of small or medium result sets, and minimizes the duration of internal database locks, thus increasing concurrency. - -WARNING, if the result set is too big to fit in the available memory, it can lead to prolonged GC pauses and even `OutOfMemoryError` exceptions. This property is deprecated since Ignite 2.15.0. - -To change the default behavior: - -[tabs] --- - -tab:Java[] -[source,java] ----- -SqlFieldsQuery query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10"); - -// Result set will be loaded eagerly. -query.setLazy(false); ----- -tab:JDBC[] -[source,sql] ----- -jdbc:ignite:thin://192.168.0.15?lazy=false ----- -tab:C#/.NET[] -[source,csharp] ----- -var query = new SqlFieldsQuery("SELECT * FROM Person WHERE id > 10") -{ - // Result set will be loaded eagerly. - Lazy = false -}; ----- -tab:C++[] --- - -//// -*TODO* Add tabs for ODBC and other programming languages - C# and C++ -//// +Ignite always operates in lazy loading mode. Query results are not loaded entirely into memory — data is streamed to +the client in pages as the result set is iterated. The page size determines how many rows are fetched per network round +trip, allowing you to balance memory consumption and performance and eliminating the risk of prolonged GC pauses +and `OutOfMemoryError` exceptions for large result sets. == Querying Colocated Data diff --git a/docs/_docs/thin-clients/python-thin-client.adoc b/docs/_docs/thin-clients/python-thin-client.adoc index 4bbbd8c584f9c..17b493a4ff549 100644 --- a/docs/_docs/thin-clients/python-thin-client.adoc +++ b/docs/_docs/thin-clients/python-thin-client.adoc @@ -422,7 +422,6 @@ The `sql()` method supports a number of parameters that | `replicated_only` | | `enforce_join_order` | | `collocated` | -| `lazy` | | `include_field_names` | | `max_rows` | | `timeout` | @@ -485,4 +484,3 @@ If you still want to use authentication without securing the connection, simply ---- include::{sourceFileDir}/auth.py[tag=no-ssl,indent=0] ---- - diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/QueryRegistryImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/QueryRegistryImpl.java index fd8b9062e9711..3b9e6f96b1bb4 100644 --- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/QueryRegistryImpl.java +++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/QueryRegistryImpl.java @@ -58,7 +58,7 @@ public QueryRegistryImpl(GridKernalContext ctx) { RunningQueryManager qryMgr = kctx.query().runningQueryManager(); long locId = qryMgr.register(rootQry.sql(), GridCacheQueryType.SQL_FIELDS, rootQry.context().schemaName(), - false, createCancelToken(qry), rootQry.initiatorId(), false, true, false); + false, createCancelToken(qry), rootQry.initiatorId(), false, false); rootQry.localQueryId(locId); diff --git a/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java b/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java index bc721296bd5eb..c00e27cf547b5 100644 --- a/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/common/RunningQueryInfoCheckInitiatorTest.java @@ -19,6 +19,7 @@ import java.sql.Connection; import java.sql.DriverManager; +import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.List; @@ -27,7 +28,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; import java.util.regex.Pattern; - import org.apache.ignite.Ignite; import org.apache.ignite.Ignition; import org.apache.ignite.cache.query.FieldsQueryCursor; @@ -227,10 +227,16 @@ public void testJdbcV2InitiatorId() throws Exception { final UUID grid0NodeId = grid(0).cluster().localNode().id(); GridTestUtils.runAsync(() -> { - try (Connection conn = DriverManager.getConnection(CFG_URL_PREFIX + "lazy=false:nodeId=" + try (Connection conn = DriverManager.getConnection(CFG_URL_PREFIX + "nodeId=" + grid0NodeId + "@modules/clients/src/test/config/jdbc-security-config.xml")) { try (Statement stmt = conn.createStatement()) { stmt.execute(sql); + + ResultSet rs = stmt.getResultSet(); + + while (rs != null && rs.next()) { + // No-op. + } } } catch (SQLException e) { diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcConnectionSelfTest.java index 763b0b4681348..b8056bfaca7a8 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcConnectionSelfTest.java @@ -31,7 +31,6 @@ import org.junit.Test; import static org.apache.ignite.IgniteJdbcDriver.CFG_URL_PREFIX; -import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY; /** * Connection test. @@ -270,7 +269,6 @@ public void testSqlHints() throws Exception { assertTrue(((JdbcConnection)conn).isEnforceJoinOrder()); assertFalse(((JdbcConnection)conn).isDistributedJoins()); assertFalse(((JdbcConnection)conn).isCollocatedQuery()); - assertEquals(DFLT_LAZY, ((JdbcConnection)conn).isLazy()); assertFalse(((JdbcConnection)conn).skipReducerOnUpdate()); } @@ -279,7 +277,6 @@ public void testSqlHints() throws Exception { assertFalse(((JdbcConnection)conn).isEnforceJoinOrder()); assertTrue(((JdbcConnection)conn).isDistributedJoins()); assertFalse(((JdbcConnection)conn).isCollocatedQuery()); - assertEquals(DFLT_LAZY, ((JdbcConnection)conn).isLazy()); assertFalse(((JdbcConnection)conn).skipReducerOnUpdate()); } @@ -288,23 +285,14 @@ public void testSqlHints() throws Exception { assertFalse(((JdbcConnection)conn).isEnforceJoinOrder()); assertFalse(((JdbcConnection)conn).isDistributedJoins()); assertTrue(((JdbcConnection)conn).isCollocatedQuery()); - assertEquals(DFLT_LAZY, ((JdbcConnection)conn).isLazy()); assertFalse(((JdbcConnection)conn).skipReducerOnUpdate()); } - try (final Connection conn = DriverManager.getConnection(CFG_URL_PREFIX + "lazy=" + (!DFLT_LAZY) + "@" + configURL())) { - assertFalse(((JdbcConnection)conn).isEnforceJoinOrder()); - assertFalse(((JdbcConnection)conn).isDistributedJoins()); - assertFalse(((JdbcConnection)conn).isCollocatedQuery()); - assertEquals(!DFLT_LAZY, ((JdbcConnection)conn).isLazy()); - assertFalse(((JdbcConnection)conn).skipReducerOnUpdate()); - } try (final Connection conn = DriverManager.getConnection(CFG_URL_PREFIX + "skipReducerOnUpdate=true@" + configURL())) { assertFalse(((JdbcConnection)conn).isEnforceJoinOrder()); assertFalse(((JdbcConnection)conn).isDistributedJoins()); assertFalse(((JdbcConnection)conn).isCollocatedQuery()); - assertEquals(DFLT_LAZY, ((JdbcConnection)conn).isLazy()); assertTrue(((JdbcConnection)conn).skipReducerOnUpdate()); } } diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java index 2d46232ec0343..853334e7b0c80 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java @@ -66,7 +66,6 @@ import static java.sql.ResultSet.TYPE_FORWARD_ONLY; import static java.sql.Statement.NO_GENERATED_KEYS; import static java.sql.Statement.RETURN_GENERATED_KEYS; -import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY; import static org.apache.ignite.testframework.GridTestUtils.assertThrows; import static org.apache.ignite.testframework.GridTestUtils.assertThrowsAnyCause; import static org.apache.ignite.testframework.GridTestUtils.getFieldValue; @@ -376,44 +375,32 @@ public void testPartitionAwarenessPartitionDistributionsCacheSizePropertySemicol @Test public void testSqlHints() throws Exception { try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp)) { - assertHints(conn, false, false, false, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, false, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&distributedJoins=true")) { - assertHints(conn, true, false, false, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, true, false, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&enforceJoinOrder=true")) { - assertHints(conn, false, true, false, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, true, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&collocated=true")) { - assertHints(conn, false, false, true, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, false, true, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&replicatedOnly=true")) { - assertHints(conn, false, false, false, true, DFLT_LAZY, - false, partitionAwareness); - } - - try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&lazy=" + (!DFLT_LAZY))) { - assertHints(conn, false, false, false, false, !DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, false, false, true, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&skipReducerOnUpdate=true")) { - assertHints(conn, false, false, false, false, DFLT_LAZY, - true, partitionAwareness); + assertHints(conn, false, false, false, false, true, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessProp + "&distributedJoins=true&" + - "enforceJoinOrder=true&collocated=true&replicatedOnly=true&lazy=" + (!DFLT_LAZY) + "&skipReducerOnUpdate=true")) { - assertHints(conn, true, true, true, true, !DFLT_LAZY, - true, partitionAwareness); + "enforceJoinOrder=true&collocated=true&replicatedOnly=true&skipReducerOnUpdate=true")) { + assertHints(conn, true, true, true, true, true, partitionAwareness); } } @@ -425,39 +412,32 @@ public void testSqlHints() throws Exception { @Test public void testSqlHintsSemicolon() throws Exception { try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";distributedJoins=true")) { - assertHints(conn, true, false, false, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, true, false, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";enforceJoinOrder=true")) { - assertHints(conn, false, true, false, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, true, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";collocated=true")) { - assertHints(conn, false, false, true, false, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, false, true, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";replicatedOnly=true")) { - assertHints(conn, false, false, false, true, DFLT_LAZY, - false, partitionAwareness); + assertHints(conn, false, false, false, true, false, partitionAwareness); } - try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";lazy=" + (!DFLT_LAZY))) { - assertHints(conn, false, false, false, false, !DFLT_LAZY, - false, partitionAwareness); + try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon)) { + assertHints(conn, false, false, false, false, false, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";skipReducerOnUpdate=true")) { - assertHints(conn, false, false, false, false, DFLT_LAZY, - true, partitionAwareness); + assertHints(conn, false, false, false, false, true, partitionAwareness); } try (Connection conn = DriverManager.getConnection(urlWithPartitionAwarenessPropSemicolon + ";distributedJoins=true;" + - "enforceJoinOrder=true;collocated=true;replicatedOnly=true;lazy=" + (!DFLT_LAZY) + ";skipReducerOnUpdate=true")) { - assertHints(conn, true, true, true, true, !DFLT_LAZY, - true, partitionAwareness); + "enforceJoinOrder=true;collocated=true;replicatedOnly=true;skipReducerOnUpdate=true")) { + assertHints(conn, true, true, true, true, true, partitionAwareness); } } @@ -469,18 +449,18 @@ public void testSqlHintsSemicolon() throws Exception { * @param enforceJoinOrder Enforce join order. * @param collocated Co-located. * @param replicatedOnly Replicated only. - * @param lazy Lazy. * @param skipReducerOnUpdate Skip reducer on update. * @throws Exception If failed. */ - private void assertHints(Connection conn, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, - boolean replicatedOnly, boolean lazy, boolean skipReducerOnUpdate, boolean partitionAwarenessEnabled)throws Exception { + private void assertHints( + Connection conn, boolean distributedJoins, boolean enforceJoinOrder, boolean collocated, + boolean replicatedOnly, boolean skipReducerOnUpdate, boolean partitionAwarenessEnabled + ) throws Exception { for (JdbcThinTcpIo io: ios(conn)) { assertEquals(distributedJoins, io.connectionProperties().isDistributedJoins()); assertEquals(enforceJoinOrder, io.connectionProperties().isEnforceJoinOrder()); assertEquals(collocated, io.connectionProperties().isCollocated()); assertEquals(replicatedOnly, io.connectionProperties().isReplicatedOnly()); - assertEquals(lazy, io.connectionProperties().isLazy()); assertEquals(skipReducerOnUpdate, io.connectionProperties().isSkipReducerOnUpdate()); assertEquals(partitionAwarenessEnabled, io.connectionProperties().isPartitionAwareness()); } diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java index 1986e8b84cb58..55ec37c3cbce3 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDataSourceSelfTest.java @@ -44,8 +44,6 @@ import org.apache.ignite.testframework.GridTestUtils; import org.junit.Test; -import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY; - /** * DataSource test. */ @@ -130,15 +128,13 @@ public void testUrlCompose() throws Exception { public void testResetUrl() throws Exception { IgniteJdbcThinDataSource ids = new IgniteJdbcThinDataSource(); - ids.setUrl("jdbc:ignite:thin://127.0.0.1:10800/test?lazy=" + (!DFLT_LAZY)); + ids.setUrl("jdbc:ignite:thin://127.0.0.1:10800/test"); assertEquals("test", ids.getSchema()); - assertEquals(!DFLT_LAZY, ids.isLazy()); ids.setUrl("jdbc:ignite:thin://mydomain.org,localhost?collocated=true"); assertNull(ids.getSchema()); - assertEquals(DFLT_LAZY, ids.isLazy()); assertTrue(ids.isCollocated()); ids.setUrl("jdbc:ignite:thin://127.0.0.1:10800?local=true"); @@ -161,7 +157,6 @@ public void testSqlHints() throws Exception { assertFalse(io.connectionProperties().isAutoCloseServerCursor()); assertFalse(io.connectionProperties().isCollocated()); assertFalse(io.connectionProperties().isEnforceJoinOrder()); - assertEquals(DFLT_LAZY, io.connectionProperties().isLazy()); assertFalse(io.connectionProperties().isDistributedJoins()); assertFalse(io.connectionProperties().isReplicatedOnly()); assertFalse(io.connectionProperties().isLocal()); @@ -171,7 +166,6 @@ public void testSqlHints() throws Exception { ids.setAutoCloseServerCursor(true); ids.setCollocated(true); ids.setEnforceJoinOrder(true); - ids.setLazy(!DFLT_LAZY); ids.setDistributedJoins(true); ids.setReplicatedOnly(true); ids.setLocal(true); @@ -182,7 +176,6 @@ public void testSqlHints() throws Exception { assertTrue(io.connectionProperties().isAutoCloseServerCursor()); assertTrue(io.connectionProperties().isCollocated()); assertTrue(io.connectionProperties().isEnforceJoinOrder()); - assertEquals(!DFLT_LAZY, io.connectionProperties().isLazy()); assertTrue(io.connectionProperties().isDistributedJoins()); assertTrue(io.connectionProperties().isReplicatedOnly()); assertTrue(io.connectionProperties().isLocal()); diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java index 9a0a1a332437b..c0a918cdba787 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinLocalQueriesSelfTest.java @@ -67,13 +67,13 @@ public void testLocalThinJdbcQuery() throws SQLException { } /** - * Test lazy query on replicated cache to check table unlock logic. + * Test query on replicated cache to check table unlock logic. */ @Test - public void testLazyMode() throws Exception { + public void test() throws Exception { final int ROWS = 10; - try (Connection c = connect(grid(0), "lazy=true&replicatedOnly=true")) { + try (Connection c = connect(grid(0), "replicatedOnly=true")) { try (Statement stmt = c.createStatement()) { stmt.executeUpdate("CREATE TABLE TEST (ID LONG PRIMARY KEY, VAL VARCHAR) " + "WITH \"TEMPLATE=REPLICATED\""); diff --git a/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsBaseTest.java b/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsBaseTest.java index 74842386baeea..a68602dc473e0 100644 --- a/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsBaseTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsBaseTest.java @@ -65,7 +65,7 @@ public class WarningOnBigQueryResultsBaseTest extends AbstractIndexingCommonTest /** Log message pattern. */ private static final Pattern logPtrn = Pattern.compile( "fetched=([0-9]+), duration=([0-9]+)ms, type=(MAP|LOCAL|REDUCE), distributedJoin=(true|false), " + - "enforceJoinOrder=(true|false), lazy=(true|false), schema=(\\S+), initiatorId=(\\S+), sql"); + "enforceJoinOrder=(true|false), schema=(\\S+), initiatorId=(\\S+), sql"); /** Test log. */ private static Map logListeners = new HashMap<>(); @@ -227,9 +227,6 @@ public static class BigResultsLogListener extends LogListener { /** Duration. */ ArrayList duration = new ArrayList<>(); - /** Lazy flag. */ - boolean lazy; - /** Enforce join order flag. */ boolean enforceJoinOrder; @@ -271,8 +268,7 @@ public static class BigResultsLogListener extends LogListener { type = m.group(3); distributedJoin = Boolean.parseBoolean(m.group(4)); enforceJoinOrder = Boolean.parseBoolean(m.group(5)); - lazy = Boolean.parseBoolean(m.group(6)); - schema = m.group(7); + schema = m.group(6); sql = s.substring(s.indexOf(", sql='") + 7, s.indexOf("', plan=")); plan = s.substring(s.indexOf("', plan=") + 8, s.indexOf(", reqId=")); diff --git a/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsTest.java b/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsTest.java index 4fd2df852539f..65b57dd7699e7 100644 --- a/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/qa/query/WarningOnBigQueryResultsTest.java @@ -123,7 +123,6 @@ public void testQueryCacheTest0() throws Exception { assertFalse(listener(grid("cli")).enforceJoinOrder); assertFalse(listener(grid("cli")).distributedJoin); - assertFalse(listener(grid("cli")).lazy); checkStateAfterQuery0("TEST0"); } @@ -154,7 +153,6 @@ public void testQueryCacheTest1() throws Exception { assertEquals(KEYS_PER_NODE * 2, grid("cli").context().query().querySqlFields(new SqlFieldsQueryEx("SELECT * FROM TEST1", true) .setSchema("TEST1") - .setLazy(true) .setEnforceJoinOrder(true), false).getAll().size()); @@ -180,9 +178,6 @@ public void testQueryCacheTest1() throws Exception { assertFalse(listener(grid(2)).distributedJoin); assertFalse(listener(grid(3)).distributedJoin); - - assertTrue(listener(grid(2)).lazy); - assertTrue(listener(grid(3)).lazy); } /** @@ -310,8 +305,5 @@ private void checkStateAfterQuery0(String schema) { assertFalse(listener(grid(0)).distributedJoin); assertFalse(listener(grid(1)).distributedJoin); - - assertTrue(listener(grid(0)).lazy); - assertTrue(listener(grid(1)).lazy); } } diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java index eed4624c5fb6b..14875e291745e 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcDriver.java @@ -106,18 +106,6 @@ * {@code enforceJoinOrder} - Sets flag to enforce join order of tables in the query. If set to {@code true} * query optimizer will not reorder tables in join. By default is {@code false}. * - *
  • - * {@code lazy} - Sets flag to enable lazy query execution. - * By default Ignite attempts to fetch the whole query result set to memory and send it to the client. - * For small and medium result sets this provides optimal performance and minimize duration of internal - * database locks, thus increasing concurrency. - * - *

    If result set is too big to fit in available memory this could lead to excessive GC pauses and even - * OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory - * consumption at the cost of moderate performance hit. - * - *

    Defaults to {@code false}, meaning that the whole result set is fetched to memory eagerly. - *

  • * *

    Example

    *
    @@ -194,9 +182,6 @@ public class IgniteJdbcDriver implements Driver {
         /** Parameter: enforce join order flag (SQL hint). */
         public static final String PARAM_ENFORCE_JOIN_ORDER = "enforceJoinOrder";
     
    -    /** Parameter: replicated only flag (SQL hint). */
    -    public static final String PARAM_LAZY = "lazy";
    -
         /** Parameter: schema name. */
         public static final String PARAM_SCHEMA = "schema";
     
    @@ -248,9 +233,6 @@ public class IgniteJdbcDriver implements Driver {
         /** Transactions allowed property name. */
         public static final String PROP_ENFORCE_JOIN_ORDER = PROP_PREFIX + PARAM_ENFORCE_JOIN_ORDER;
     
    -    /** Lazy property name. */
    -    public static final String PROP_LAZY = PROP_PREFIX + PARAM_LAZY;
    -
         /** Schema property name. */
         public static final String PROP_SCHEMA = PROP_PREFIX + PARAM_SCHEMA;
     
    @@ -314,7 +296,6 @@ public class IgniteJdbcDriver implements Driver {
                 new JdbcDriverPropertyInfo("Collocated", info.getProperty(PROP_COLLOCATED), ""),
                 new JdbcDriverPropertyInfo("Distributed Joins", info.getProperty(PROP_DISTRIBUTED_JOINS), ""),
                 new JdbcDriverPropertyInfo("Enforce Join Order", info.getProperty(PROP_ENFORCE_JOIN_ORDER), ""),
    -            new JdbcDriverPropertyInfo("Lazy query execution", info.getProperty(PROP_LAZY), ""),
                 new JdbcDriverPropertyInfo("Transactions Allowed", info.getProperty(PROP_TX_ALLOWED), ""),
                 new JdbcDriverPropertyInfo("Queries with multiple statements allowed", info.getProperty(PROP_MULTIPLE_STMTS), ""),
                 new JdbcDriverPropertyInfo("Skip reducer on update", info.getProperty(PROP_SKIP_REDUCER_ON_UPDATE), ""),
    diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
    index bc5dc85977c02..ea30d704ae021 100644
    --- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
    +++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java
    @@ -311,24 +311,6 @@ public void setTcpNoDelay(boolean tcpNoDelay) {
             props.setTcpNoDelay(tcpNoDelay);
         }
     
    -    /**
    -     * @return Lazy query execution flag.
    -     * @deprecated Use query page size property instead.
    -     */
    -    @Deprecated(forRemoval = true)
    -    public boolean isLazy() {
    -        return props.isLazy();
    -    }
    -
    -    /**
    -     * @param lazy Lazy query execution flag.
    -     * @deprecated Use query page size property instead.
    -     */
    -    @Deprecated(forRemoval = true)
    -    public void setLazy(boolean lazy) {
    -        props.setLazy(lazy);
    -    }
    -
         /**
          * @return Local query flag.
          */
    diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
    index bbb9d38537073..b1c36a9015827 100644
    --- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
    +++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
    @@ -722,15 +722,6 @@ public final class IgniteSystemProperties extends IgniteCommonsSystemProperties
             "parse the statement")
         public static final String IGNITE_SQL_PARSER_DISABLE_H2_FALLBACK = "IGNITE_SQL_PARSER_DISABLE_H2_FALLBACK";
     
    -    /**
    -     *  Force all SQL queries to be processed lazily regardless of what clients request.
    -     *
    -     * @deprecated Since version 2.8.
    -     */
    -    @Deprecated
    -    @SystemProperty("Force all SQL queries to be processed lazily regardless of what clients request")
    -    public static final String IGNITE_SQL_FORCE_LAZY_RESULT_SET = "IGNITE_SQL_FORCE_LAZY_RESULT_SET";
    -
         /** Disable SQL system views. */
         @SystemProperty("Disables SQL system views")
         public static final String IGNITE_SQL_DISABLE_SYSTEM_VIEWS = "IGNITE_SQL_DISABLE_SYSTEM_VIEWS";
    diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
    index bab9c5ad6bf5d..af4ef81fa38aa 100644
    --- a/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
    +++ b/modules/core/src/main/java/org/apache/ignite/cache/query/SqlFieldsQuery.java
    @@ -57,10 +57,6 @@ public class SqlFieldsQuery extends Query> {
         /** Threaded query originator. */
         private static ThreadLocal threadedQryInitiatorId = new ThreadLocal<>();
     
    -    /** Do not remove. For tests only. */
    -    @SuppressWarnings("NonConstantFieldWithUpperCaseName")
    -    public static boolean DFLT_LAZY = true;
    -
         /** SQL Query. */
         private String sql;
     
    @@ -83,12 +79,6 @@ public class SqlFieldsQuery extends Query> {
         /** */
         private boolean replicatedOnly;
     
    -    /**
    -     * Lazy mode is default since Ignite v.2.8.
    -     * @deprecated Use {@link #setPageSize(int)} instead.
    -     */
    -    private boolean lazy = DFLT_LAZY;
    -
         /** Partitions for query */
         private int[] parts;
     
    @@ -120,7 +110,6 @@ public SqlFieldsQuery(SqlFieldsQuery qry) {
             enforceJoinOrder = qry.enforceJoinOrder;
             distributedJoins = qry.distributedJoins;
             replicatedOnly = qry.replicatedOnly;
    -        lazy = qry.lazy;
             parts = qry.parts;
             schema = qry.schema;
             updateBatchSize = qry.updateBatchSize;
    @@ -322,43 +311,6 @@ public boolean isReplicatedOnly() {
             return replicatedOnly;
         }
     
    -    /**
    -     * Sets lazy query execution flag.
    -     * 

    - * If {@code lazy=false} Ignite will attempt to fetch the whole query result set to memory and send it to the client. For small - * and medium result sets this provides optimal performance and minimize duration of internal database locks, thus - * increasing concurrency. - *

    - * If result set is too big to fit in available memory this could lead to excessive GC pauses and even - * {@link OutOfMemoryError}. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory - * consumption at the cost of moderate performance hit. - *

    - * Defaults to {@code true}, meaning that the only first page of result set is fetched to memory. - * - * @param lazy Lazy query execution flag. - * @return {@code this} For chaining. - * @deprecated Use {@link #setPageSize(int)} instead. - */ - @Deprecated(forRemoval = true) - public SqlFieldsQuery setLazy(boolean lazy) { - this.lazy = lazy; - - return this; - } - - /** - * Gets lazy query execution flag. - *

    - * See {@link #setLazy(boolean)} for more information. - * - * @return Lazy flag. - * @deprecated Use {@link #getPageSize()} instead. - */ - @Deprecated(forRemoval = true) - public boolean isLazy() { - return lazy; - } - /** * @return Partitions for query, in ascending order. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java index ddac964217091..474c4e45709ab 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java @@ -557,7 +557,7 @@ void write(SqlFieldsQuery qry, BinaryOutputStream out, ProtocolContext protocolC out.writeBoolean(qry.isReplicatedOnly()); out.writeBoolean(qry.isEnforceJoinOrder()); out.writeBoolean(qry.isCollocated()); - out.writeBoolean(qry.isLazy()); + out.writeBoolean(true); // Lazy flag. out.writeLong(qry.getTimeout()); out.writeBoolean(true); // include column names diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionProperties.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionProperties.java index 34e829be44442..21e745e289c16 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionProperties.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionProperties.java @@ -146,16 +146,6 @@ public interface ConnectionProperties { */ public void setTcpNoDelay(boolean tcpNoDelay); - /** - * @return Lazy query execution flag. - */ - public boolean isLazy(); - - /** - * @param lazy Lazy query execution flag. - */ - public void setLazy(boolean lazy); - /** * @return Skip reducer on update flag. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java index a0f84fa74c8dc..34bad38d91e5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java @@ -32,8 +32,6 @@ import org.apache.ignite.transactions.TransactionConcurrency; import org.jetbrains.annotations.Nullable; -import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY; - /** * Holds JDBC connection properties. */ @@ -90,10 +88,6 @@ public class ConnectionPropertiesImpl implements ConnectionProperties, Serializa private final BooleanProperty tcpNoDelay = new BooleanProperty( "tcpNoDelay", "TCP no delay flag", true, false); - /** Lazy query execution property. */ - private final BooleanProperty lazy = new BooleanProperty( - "lazy", "Enable lazy query execution", DFLT_LAZY, false); - /** Socket send buffer size property. */ private final IntegerProperty socketSendBuffer = new IntegerProperty( "socketSendBuffer", "Socket send buffer size", @@ -272,7 +266,7 @@ public class ConnectionPropertiesImpl implements ConnectionProperties, Serializa /** Properties array. */ private final ConnectionProperty[] propsArr = { distributedJoins, enforceJoinOrder, collocated, replicatedOnly, autoCloseServerCursor, - tcpNoDelay, lazy, loc, socketSendBuffer, socketReceiveBuffer, skipReducerOnUpdate, + tcpNoDelay, loc, socketSendBuffer, socketReceiveBuffer, skipReducerOnUpdate, sslMode, sslCipherSuites, sslProtocol, sslKeyAlgorithm, sslClientCertificateKeyStoreUrl, sslClientCertificateKeyStorePassword, sslClientCertificateKeyStoreType, sslTrustCertificateKeyStoreUrl, sslTrustCertificateKeyStorePassword, sslTrustCertificateKeyStoreType, @@ -427,16 +421,6 @@ public class ConnectionPropertiesImpl implements ConnectionProperties, Serializa tcpNoDelay.setValue(val); } - /** {@inheritDoc} */ - @Override public boolean isLazy() { - return lazy.value(); - } - - /** {@inheritDoc} */ - @Override public void setLazy(boolean val) { - lazy.setValue(val); - } - /** {@inheritDoc} */ @Override public boolean isSkipReducerOnUpdate() { return skipReducerOnUpdate.value(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java index e1f1cf88c7608..9c3327600cb3c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinTcpIo.java @@ -287,7 +287,7 @@ private HandshakeResult handshake(ClientListenerProtocolVersion ver) throws IOEx writer.writeBoolean(connProps.isCollocated()); writer.writeBoolean(connProps.isReplicatedOnly()); writer.writeBoolean(connProps.isAutoCloseServerCursor()); - writer.writeBoolean(connProps.isLazy()); + writer.writeBoolean(true); // Lazy flag. writer.writeBoolean(connProps.isSkipReducerOnUpdate()); if (ver.compareTo(VER_2_7_0) >= 0) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection.java index 31ccf65535137..8037950971434 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection.java @@ -82,7 +82,6 @@ import static org.apache.ignite.IgniteJdbcDriver.PROP_COLLOCATED; import static org.apache.ignite.IgniteJdbcDriver.PROP_DISTRIBUTED_JOINS; import static org.apache.ignite.IgniteJdbcDriver.PROP_ENFORCE_JOIN_ORDER; -import static org.apache.ignite.IgniteJdbcDriver.PROP_LAZY; import static org.apache.ignite.IgniteJdbcDriver.PROP_LOCAL; import static org.apache.ignite.IgniteJdbcDriver.PROP_MULTIPLE_STMTS; import static org.apache.ignite.IgniteJdbcDriver.PROP_NODE_ID; @@ -94,7 +93,6 @@ import static org.apache.ignite.IgniteJdbcDriver.PROP_STREAMING_PER_NODE_BUF_SIZE; import static org.apache.ignite.IgniteJdbcDriver.PROP_STREAMING_PER_NODE_PAR_OPS; import static org.apache.ignite.IgniteJdbcDriver.PROP_TX_ALLOWED; -import static org.apache.ignite.cache.query.SqlFieldsQuery.DFLT_LAZY; import static org.apache.ignite.internal.GridClosureCallMode.BALANCE; import static org.apache.ignite.internal.jdbc2.JdbcUtils.convertToSqlException; import static org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode.createJdbcSqlException; @@ -166,9 +164,6 @@ public class JdbcConnection implements Connection { /** Enforced join order flag. */ private boolean enforceJoinOrder; - /** Lazy query execution flag. */ - private boolean lazy; - /** Transactions allowed flag. */ private boolean txAllowed; @@ -227,7 +222,6 @@ public JdbcConnection(String url, Properties props) throws SQLException { collocatedQry = Boolean.parseBoolean(props.getProperty(PROP_COLLOCATED)); distributedJoins = Boolean.parseBoolean(props.getProperty(PROP_DISTRIBUTED_JOINS)); enforceJoinOrder = Boolean.parseBoolean(props.getProperty(PROP_ENFORCE_JOIN_ORDER)); - lazy = Boolean.parseBoolean(props.getProperty(PROP_LAZY, String.valueOf(DFLT_LAZY))); txAllowed = Boolean.parseBoolean(props.getProperty(PROP_TX_ALLOWED)); stream = Boolean.parseBoolean(props.getProperty(PROP_STREAMING)); @@ -951,13 +945,6 @@ boolean isEnforceJoinOrder() { return enforceJoinOrder; } - /** - * @return Lazy query execution flag. - */ - boolean isLazy() { - return lazy; - } - /** * Ensures that connection is not closed. * diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsNotAllowTask.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsNotAllowTask.java index 6d295f631ca66..87486b33023df 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsNotAllowTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsNotAllowTask.java @@ -39,14 +39,13 @@ class JdbcQueryMultipleStatementsNotAllowTask extends JdbcQueryMultipleStatement * @param locQry Local query flag. * @param collocatedQry Collocated query flag. * @param distributedJoins Distributed joins flag. - * @param enforceJoinOrder Enforce joins order falg. - * @param lazy Lazy query execution flag. + * @param enforceJoinOrder Enforce joins order flag. */ public JdbcQueryMultipleStatementsNotAllowTask(Ignite ignite, String schemaName, String sql, Boolean isQry, boolean loc, Object[] args, int fetchSize, boolean locQry, boolean collocatedQry, boolean distributedJoins, - boolean enforceJoinOrder, boolean lazy) { + boolean enforceJoinOrder) { super(ignite, schemaName, sql, isQry, loc, args, fetchSize, locQry, collocatedQry, distributedJoins, - enforceJoinOrder, lazy); + enforceJoinOrder); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java index 0287ceb3adbfd..9b0ae1935d5da 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java @@ -78,9 +78,6 @@ class JdbcQueryMultipleStatementsTask implements IgniteCallable> fldQryCursor = cache.withKeepBinary().query(qry); @@ -237,13 +236,6 @@ protected boolean enforceJoinOrder() { return false; } - /** - * @return Lazy query execution flag (SQL hit). - */ - protected boolean lazy() { - return false; - } - /** * @return Flag to update metadata on demand. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV2.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV2.java index 8365b4e9773a7..ac37025326919 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV2.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV2.java @@ -36,9 +36,6 @@ class JdbcQueryTaskV2 extends JdbcQueryTask { /** Enforce join order flag. */ private final boolean enforceJoinOrder; - /** Lazy query execution flag. */ - private final boolean lazy; - /** * @param ignite Ignite. * @param cacheName Cache name. @@ -52,17 +49,15 @@ class JdbcQueryTaskV2 extends JdbcQueryTask { * @param locQry Local query flag. * @param collocatedQry Collocated query flag. * @param distributedJoins Distributed joins flag. - * @param enforceJoinOrder Enforce joins order falg. - * @param lazy Lazy query execution flag. + * @param enforceJoinOrder Enforce joins order flag. */ public JdbcQueryTaskV2(Ignite ignite, String cacheName, String schemaName, String sql, Boolean isQry, boolean loc, Object[] args, int fetchSize, UUID uuid, boolean locQry, boolean collocatedQry, boolean distributedJoins, - boolean enforceJoinOrder, boolean lazy) { + boolean enforceJoinOrder) { super(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, uuid, locQry, collocatedQry, distributedJoins); this.enforceJoinOrder = enforceJoinOrder; - this.lazy = lazy; } /** {@inheritDoc} */ @@ -70,11 +65,6 @@ public JdbcQueryTaskV2(Ignite ignite, String cacheName, String schemaName, Strin return enforceJoinOrder; } - /** {@inheritDoc} */ - @Override protected boolean lazy() { - return lazy; - } - /** * @param ignite Ignite. * @param cacheName Cache name. @@ -89,17 +79,16 @@ public JdbcQueryTaskV2(Ignite ignite, String cacheName, String schemaName, Strin * @param collocatedQry Collocated query flag. * @param distributedJoins Distributed joins flag. * @param enforceJoinOrder Enforce joins order falg. - * @param lazy Lazy query execution flag. * @return Appropriate task JdbcQueryTask or JdbcQueryTaskV2. */ public static JdbcQueryTask createTask(Ignite ignite, String cacheName, String schemaName, String sql, Boolean isQry, boolean loc, Object[] args, int fetchSize, UUID uuid, boolean locQry, boolean collocatedQry, boolean distributedJoins, - boolean enforceJoinOrder, boolean lazy) { + boolean enforceJoinOrder) { - if (enforceJoinOrder || lazy) + if (enforceJoinOrder) return new JdbcQueryTaskV2(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, - uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder, lazy); + uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder); else return new JdbcQueryTask(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, uuid, locQry, collocatedQry, distributedJoins); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV3.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV3.java index 0ba679923bcca..084b38a104084 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV3.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTaskV3.java @@ -47,15 +47,14 @@ class JdbcQueryTaskV3 extends JdbcQueryTaskV2 { * @param collocatedQry Collocated query flag. * @param distributedJoins Distributed joins flag. * @param enforceJoinOrder Enforce joins order flag. - * @param lazy Lazy query execution flag. * @param updateMeta Update metadata on demand. * @param skipReducerOnUpdate Flkag to enable server side updates. */ public JdbcQueryTaskV3(Ignite ignite, String cacheName, String schemaName, String sql, Boolean isQry, boolean loc, Object[] args, int fetchSize, UUID uuid, boolean locQry, boolean collocatedQry, boolean distributedJoins, - boolean enforceJoinOrder, boolean lazy, boolean updateMeta, boolean skipReducerOnUpdate) { + boolean enforceJoinOrder, boolean updateMeta, boolean skipReducerOnUpdate) { super(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, uuid, locQry, - collocatedQry, distributedJoins, enforceJoinOrder, lazy); + collocatedQry, distributedJoins, enforceJoinOrder); this.updateMeta = updateMeta; this.skipReducerOnUpdate = skipReducerOnUpdate; @@ -85,7 +84,6 @@ public JdbcQueryTaskV3(Ignite ignite, String cacheName, String schemaName, Strin * @param collocatedQry Collocated query flag. * @param distributedJoins Distributed joins flag. * @param enforceJoinOrder Enforce joins order flag. - * @param lazy Lazy query execution flag. * @param updateMeta Update metadata on demand. * @param skipReducerOnUpdate Update on server flag. * @return Appropriate task JdbcQueryTask or JdbcQueryTaskV2. @@ -93,13 +91,13 @@ public JdbcQueryTaskV3(Ignite ignite, String cacheName, String schemaName, Strin public static JdbcQueryTask createTask(Ignite ignite, String cacheName, String schemaName, String sql, Boolean isQry, boolean loc, Object[] args, int fetchSize, UUID uuid, boolean locQry, boolean collocatedQry, boolean distributedJoins, - boolean enforceJoinOrder, boolean lazy, boolean updateMeta, boolean skipReducerOnUpdate) { + boolean enforceJoinOrder, boolean updateMeta, boolean skipReducerOnUpdate) { if (updateMeta || skipReducerOnUpdate) return new JdbcQueryTaskV3(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, - uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder, lazy, updateMeta, skipReducerOnUpdate); + uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder, updateMeta, skipReducerOnUpdate); else return JdbcQueryTaskV2.createTask(ignite, cacheName, schemaName, sql, isQry, loc, args, fetchSize, - uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder, lazy); + uuid, locQry, collocatedQry, distributedJoins, enforceJoinOrder); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcResultSet.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcResultSet.java index 53746e50c333f..ebd486a9dac0e 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcResultSet.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcResultSet.java @@ -232,7 +232,7 @@ private void fetchPage() throws SQLException { // Connections from new clients send queries with new tasks, so we have to continue in the same manner JdbcQueryTask qryTask = JdbcQueryTaskV3.createTask(loc ? ignite : null, conn.cacheName(), conn.schemaName(), null, true, loc, null, fetchSize, uuid, conn.isLocalQuery(), conn.isCollocatedQuery(), - conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isLazy(), updateMetadata, false); + conn.isDistributedJoins(), conn.isEnforceJoinOrder(), updateMetadata, false); try { JdbcQueryTaskResult res = loc diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java index 232b000e1de8d..d5b8a95e35585 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java @@ -112,18 +112,18 @@ private void executeMultipleStatement(String sql, Boolean isQuery) throws SQLExc if (conn.isMultipleStatementsTaskV3Supported()) { qryTask = new JdbcQueryMultipleStatementsTaskV3(loc ? ignite : null, conn.schemaName(), sql, isQuery, loc, getArgs(), fetchSize, conn.isLocalQuery(), - conn.isCollocatedQuery(), conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isLazy(), + conn.isCollocatedQuery(), conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isMultipleStatementsAllowed(), conn.clientDescriptor()); } else if (!conn.isMultipleStatementsAllowed() && conn.isMultipleStatementsTaskV2Supported()) { qryTask = new JdbcQueryMultipleStatementsNotAllowTask(loc ? ignite : null, conn.schemaName(), sql, isQuery, loc, getArgs(), fetchSize, conn.isLocalQuery(), conn.isCollocatedQuery(), - conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isLazy()); + conn.isDistributedJoins(), conn.isEnforceJoinOrder()); } else { qryTask = new JdbcQueryMultipleStatementsTask(loc ? ignite : null, conn.schemaName(), sql, isQuery, loc, getArgs(), fetchSize, conn.isLocalQuery(), conn.isCollocatedQuery(), - conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isLazy()); + conn.isDistributedJoins(), conn.isEnforceJoinOrder()); } try { @@ -173,7 +173,7 @@ private void executeSingle(String sql, Boolean isQuery) throws SQLException { JdbcQueryTask qryTask = JdbcQueryTaskV3.createTask(loc ? ignite : null, conn.cacheName(), conn.schemaName(), sql, isQuery, loc, getArgs(), fetchSize, uuid, conn.isLocalQuery(), conn.isCollocatedQuery(), - conn.isDistributedJoins(), conn.isEnforceJoinOrder(), conn.isLazy(), false, conn.skipReducerOnUpdate()); + conn.isDistributedJoins(), conn.isEnforceJoinOrder(), false, conn.skipReducerOnUpdate()); try { JdbcQueryTaskResult qryRes = loc @@ -211,7 +211,6 @@ protected void setupQuery(SqlFieldsQuery qry) { qry.setCollocated(conn.isCollocatedQuery()); qry.setDistributedJoins(conn.isDistributedJoins()); qry.setEnforceJoinOrder(conn.isEnforceJoinOrder()); - qry.setLazy(conn.isLazy()); qry.setSchema(conn.schemaName()); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java index dc64906d18a7a..4800afcb5033e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java @@ -173,12 +173,11 @@ public JdbcConnectionContext(GridKernalContext ctx, GridNioSession ses, GridSpin boolean replicatedOnly = reader.readBoolean(); boolean autoCloseCursors = reader.readBoolean(); - boolean lazyExec = false; boolean skipReducerOnUpdate = false; String qryEngine = null; if (ver.compareTo(VER_2_1_5) >= 0) - lazyExec = reader.readBoolean(); + reader.readBoolean(); // Lazy query flag. if (ver.compareTo(VER_2_3_0) >= 0) skipReducerOnUpdate = reader.readBoolean(); @@ -282,7 +281,7 @@ public JdbcConnectionContext(GridKernalContext ctx, GridNioSession ses, GridSpin boolean loc = features.contains(JdbcThinFeature.LOCAL_QUERIES); handler = new JdbcRequestHandler(busyLock, snd, maxCursors, distributedJoins, enforceJoinOrder, - collocated, replicatedOnly, autoCloseCursors, lazyExec, loc, skipReducerOnUpdate, qryEngine, + collocated, replicatedOnly, autoCloseCursors, loc, skipReducerOnUpdate, qryEngine, dataPageScanEnabled, updateBatchSize, concurrency, isolation, timeout, lb, ver, this); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java index 243c831d451e3..451dfdcc79a49 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcRequestHandler.java @@ -180,7 +180,6 @@ public class JdbcRequestHandler implements ClientListenerRequestHandler, ClientT * @param collocated Collocated flag. * @param replicatedOnly Replicated only flag. * @param autoCloseCursors Flag to automatically close server cursors. - * @param lazy Lazy query execution flag. * @param loc Local query flag. * @param skipReducerOnUpdate Skip reducer on update flag. * @param qryEngine Name of SQL query engine to use. @@ -202,7 +201,6 @@ public JdbcRequestHandler( boolean collocated, boolean replicatedOnly, boolean autoCloseCursors, - boolean lazy, boolean loc, boolean skipReducerOnUpdate, @Nullable String qryEngine, @@ -233,7 +231,6 @@ public JdbcRequestHandler( enforceJoinOrder, collocated, replicatedOnly, - lazy, loc, skipReducerOnUpdate, dataPageScanEnabled, @@ -1121,7 +1118,6 @@ private void setupQuery(SqlFieldsQueryEx qry, String schemaName) { qry.setEnforceJoinOrder(cliCtx.isEnforceJoinOrder()); qry.setCollocated(cliCtx.isCollocated()); qry.setReplicatedOnly(cliCtx.isReplicatedOnly()); - qry.setLazy(cliCtx.isLazy()); qry.setLocal(cliCtx.isLocal()); qry.setSchema(schemaName); qry.setQueryInitiatorId(connCtx.clientDescriptor()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java index 3daf31362308c..2bb58c5b0b749 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java @@ -143,10 +143,8 @@ public OdbcConnectionContext(GridKernalContext ctx, GridNioSession ses, GridSpin boolean replicatedOnly = reader.readBoolean(); boolean collocated = reader.readBoolean(); - boolean lazy = false; - if (ver.compareTo(VER_2_1_5) >= 0) - lazy = reader.readBoolean(); + reader.readBoolean(); // Lazy query flag. boolean skipReducerOnUpdate = false; @@ -203,7 +201,7 @@ public OdbcConnectionContext(GridKernalContext ctx, GridNioSession ses, GridSpin initClientDescriptor("odbc"); handler = new OdbcRequestHandler(ctx, busyLock, snd, maxCursors, distributedJoins, enforceJoinOrder, - replicatedOnly, collocated, lazy, skipReducerOnUpdate, qryEngine, ver, this); + replicatedOnly, collocated, skipReducerOnUpdate, qryEngine, ver, this); parser = new OdbcMessageParser(ctx, ver); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java index 2b9c87a6fa447..3ca6ec93055dc 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java @@ -126,7 +126,6 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler { * @param enforceJoinOrder Enforce join order flag. * @param replicatedOnly Replicated only flag. * @param collocated Collocated flag. - * @param lazy Lazy flag. * @param skipReducerOnUpdate Skip reducer on update flag. * @param qryEngine Name of SQL query engine to use. * @param ver Client protocol version. @@ -140,7 +139,6 @@ public OdbcRequestHandler( boolean enforceJoinOrder, boolean replicatedOnly, boolean collocated, - boolean lazy, boolean skipReducerOnUpdate, @Nullable String qryEngine, ClientListenerProtocolVersion ver, @@ -161,7 +159,6 @@ public OdbcRequestHandler( enforceJoinOrder, collocated, replicatedOnly, - lazy, false, skipReducerOnUpdate, null, @@ -348,7 +345,6 @@ private SqlFieldsQueryEx makeQuery(String schema, String sql) { qry.setEnforceJoinOrder(cliCtx.isEnforceJoinOrder()); qry.setReplicatedOnly(cliCtx.isReplicatedOnly()); qry.setCollocated(cliCtx.isCollocated()); - qry.setLazy(cliCtx.isLazy()); qry.setSchema(OdbcUtils.prepareSchema(schema)); qry.setSkipReducerOnUpdate(cliCtx.isSkipReducerOnUpdate()); qry.setQueryInitiatorId(connCtx.clientDescriptor()); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java index b807217f7a51c..b3c8ea8d42c66 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java @@ -1491,7 +1491,7 @@ private Query readFieldsQuery(BinaryReaderEx reader) { boolean distrJoins = reader.readBoolean(); boolean enforceJoinOrder = reader.readBoolean(); - boolean lazy = reader.readBoolean(); + reader.readBoolean(); // Lazy flag. int timeout = reader.readInt(); boolean replicated = reader.readBoolean(); boolean collocated = reader.readBoolean(); @@ -1505,7 +1505,6 @@ private Query readFieldsQuery(BinaryReaderEx reader) { .setLocal(loc) .setDistributedJoins(distrJoins) .setEnforceJoinOrder(enforceJoinOrder) - .setLazy(lazy) .setReplicatedOnly(replicated) .setCollocated(collocated) .setSchema(schema) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java index 136fc7ee898ca..972184f9791bd 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheSqlFieldsQueryRequest.java @@ -78,7 +78,7 @@ public ClientCacheSqlFieldsQueryRequest(BinaryReaderEx reader, boolean replicatedOnly = reader.readBoolean(); boolean enforceJoinOrder = reader.readBoolean(); boolean collocated = reader.readBoolean(); - boolean lazy = reader.readBoolean(); + reader.readBoolean(); // Lazy flag. int timeout = (int)reader.readLong(); includeFieldNames = reader.readBoolean(); @@ -93,8 +93,7 @@ public ClientCacheSqlFieldsQueryRequest(BinaryReaderEx reader, .setLocal(loc) .setReplicatedOnly(replicatedOnly) .setEnforceJoinOrder(enforceJoinOrder) - .setCollocated(collocated) - .setLazy(lazy); + .setCollocated(collocated); // Zero value of the timeout from the old client is interpreted as a 'default'. // So, old clients cannot disable default timeout by explicit set timeout to 0. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryFinishedInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryFinishedInfo.java index 8983f8230a4fa..24fbf358c25fe 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryFinishedInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryFinishedInfo.java @@ -53,9 +53,6 @@ public class GridQueryFinishedInfo { /** Enforce join order query flag. */ private boolean enforceJoinOrder; - /** Lazy query flag. */ - private boolean lazy; - /** Distributed joins query flag. */ private boolean distributedJoins; @@ -81,7 +78,6 @@ public class GridQueryFinishedInfo { * @param finishTime Query finish time. * @param loc Local query flag. * @param enforceJoinOrder Local query flag. - * @param lazy Local query flag. * @param distributedJoins Local query flag. * @param failed Whether query is failed or not. * @param failReason Exception that caused query execution fail. @@ -97,7 +93,6 @@ public GridQueryFinishedInfo( long finishTime, boolean loc, boolean enforceJoinOrder, - boolean lazy, boolean distributedJoins, boolean failed, @Nullable Throwable failReason, @@ -112,7 +107,6 @@ public GridQueryFinishedInfo( this.finishTime = finishTime; this.loc = loc; this.enforceJoinOrder = enforceJoinOrder; - this.lazy = lazy; this.distributedJoins = distributedJoins; this.failed = failed; this.failReason = failReason; @@ -182,13 +176,6 @@ public boolean enforceJoinOrder() { return enforceJoinOrder; } - /** - * @return Lazy flag. - */ - public boolean lazy() { - return lazy; - } - /** * @return Distributed joins. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryStartedInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryStartedInfo.java index f0e83794dbd70..3d1f9f0b81718 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryStartedInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryStartedInfo.java @@ -52,9 +52,6 @@ public class GridQueryStartedInfo { /** Enforce join order query flag. */ private boolean enforceJoinOrder; - /** Lazy query flag. */ - private boolean lazy; - /** Distributed joins query flag. */ private boolean distributedJoins; @@ -73,7 +70,6 @@ public class GridQueryStartedInfo { * @param cancellable Query cancellable flag. * @param loc Local query flag. * @param enforceJoinOrder Local query flag. - * @param lazy Local query flag. * @param distributedJoins Local query flag. * @param qryInitiatorId Query's initiator identifier. */ @@ -87,7 +83,6 @@ public GridQueryStartedInfo( boolean cancellable, boolean loc, boolean enforceJoinOrder, - boolean lazy, boolean distributedJoins, String qryInitiatorId ) { @@ -100,7 +95,6 @@ public GridQueryStartedInfo( this.cancellable = cancellable; this.loc = loc; this.enforceJoinOrder = enforceJoinOrder; - this.lazy = lazy; this.distributedJoins = distributedJoins; this.qryInitiatorId = qryInitiatorId; } @@ -168,13 +162,6 @@ public boolean enforceJoinOrder() { return enforceJoinOrder; } - /** - * @return Lazy flag. - */ - public boolean lazy() { - return lazy; - } - /** * @return Distributed joins. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/SqlClientContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/SqlClientContext.java index 481ea3674c8e0..f764aea4e91ac 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/SqlClientContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/SqlClientContext.java @@ -54,9 +54,6 @@ public class SqlClientContext implements AutoCloseable { /** Replicated caches only flag. */ private final boolean replicatedOnly; - /** Lazy query execution flag. */ - private final boolean lazy; - /** Local query flag. */ private final boolean loc; @@ -128,7 +125,6 @@ public class SqlClientContext implements AutoCloseable { * @param enforceJoinOrder Enforce join order flag. * @param collocated Collocated flag. * @param replicatedOnly Replicated caches only flag. - * @param lazy Lazy query execution flag. * @param loc Local query flag. * @param skipReducerOnUpdate Skip reducer on update flag. * @param dataPageScanEnabled Enable scan data page mode. @@ -145,7 +141,6 @@ public SqlClientContext(GridKernalContext ctx, boolean enforceJoinOrder, boolean collocated, boolean replicatedOnly, - boolean lazy, boolean loc, boolean skipReducerOnUpdate, @Nullable Boolean dataPageScanEnabled, @@ -162,7 +157,6 @@ public SqlClientContext(GridKernalContext ctx, this.enforceJoinOrder = enforceJoinOrder; this.collocated = collocated; this.replicatedOnly = replicatedOnly; - this.lazy = lazy; this.loc = loc; this.skipReducerOnUpdate = skipReducerOnUpdate; this.dataPageScanEnabled = dataPageScanEnabled; @@ -260,13 +254,6 @@ public boolean isReplicatedOnly() { return replicatedOnly; } - /** - * @return Lazy query execution flag. - */ - public boolean isLazy() { - return lazy; - } - /** * @return Local query flag. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/GridRunningQueryInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/GridRunningQueryInfo.java index 9f001585a34b5..69530a59bcbbf 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/GridRunningQueryInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/GridRunningQueryInfo.java @@ -70,9 +70,6 @@ public class GridRunningQueryInfo { /** Enforce join order flag. */ private final boolean enforceJoinOrder; - /** Lazy flag. */ - private final boolean lazy; - /** Distributed joins flag. */ private final boolean distributedJoins; @@ -93,7 +90,6 @@ public class GridRunningQueryInfo { * @param loc Local query flag. * @param qryInitiatorId Query's initiator identifier. * @param enforceJoinOrder Enforce join order flag. - * @param lazy Lazy flag. * @param distributedJoins Distributed joins flag. * @param subjId Subject ID. */ @@ -109,7 +105,6 @@ public GridRunningQueryInfo( boolean loc, String qryInitiatorId, boolean enforceJoinOrder, - boolean lazy, boolean distributedJoins, UUID subjId ) { @@ -125,7 +120,6 @@ public GridRunningQueryInfo( this.span = MTC.span(); this.qryInitiatorId = qryInitiatorId; this.enforceJoinOrder = enforceJoinOrder; - this.lazy = lazy; this.distributedJoins = distributedJoins; this.subjId = subjId; } @@ -244,13 +238,6 @@ public boolean enforceJoinOrder() { return enforceJoinOrder; } - /** - * @return Lazy flag. - */ - public boolean lazy() { - return lazy; - } - /** @return Subject ID. */ public UUID subjectId() { return subjId; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/RunningQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/RunningQueryManager.java index 04e44877b94f5..b037037cc88b4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/RunningQueryManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/RunningQueryManager.java @@ -281,13 +281,12 @@ public void start(GridSpinBusyLock busyLock) { * @param loc Local query flag. * @param cancel Query cancel. Should be passed in case query is cancelable, or {@code null} otherwise. * @param enforceJoinOrder Enforce join order flag. - * @param lazy Lazy flag. * @param distributedJoins Distributed joins flag. * @return Id of registered query. Id is a positive number. */ public long register(String qry, GridCacheQueryType qryType, String schemaName, boolean loc, @Nullable GridQueryCancel cancel, - String qryInitiatorId, boolean enforceJoinOrder, boolean lazy, boolean distributedJoins) { + String qryInitiatorId, boolean enforceJoinOrder, boolean distributedJoins) { long qryId = qryIdGen.incrementAndGet(); if (qryInitiatorId == null) @@ -305,7 +304,6 @@ public long register(String qry, GridCacheQueryType qryType, String schemaName, loc, qryInitiatorId, enforceJoinOrder, - lazy, distributedJoins, securitySubjectId(ctx) ); @@ -327,7 +325,6 @@ public long register(String qry, GridCacheQueryType qryType, String schemaName, run.cancelable(), run.local(), run.enforceJoinOrder(), - run.lazy(), run.distributedJoins(), run.queryInitiatorId() ); @@ -404,9 +401,6 @@ public void unregister(long qryId, @Nullable Throwable failReason) { if (qry.local()) flags = "local"; - if (!qry.lazy()) - flags = (flags == null ? "" : flags + ", ") + "notLazy"; - if (qry.distributedJoins()) flags = (flags == null ? "" : flags + ", ") + "distributedJoins"; @@ -443,7 +437,6 @@ public void unregister(long qryId, @Nullable Throwable failReason) { U.currentTimeMillis(), qry.local(), qry.enforceJoinOrder(), - qry.lazy(), qry.distributedJoins(), failed, failReason, diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java index 4cd64c7e08246..a027dfdfe8abb 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java @@ -212,7 +212,6 @@ public synchronized void resumeTracking() { .append(", type=").append(type) .append(", distributedJoin=").append(distributedJoin) .append(", enforceJoinOrder=").append(enforceJoinOrder) - .append(", lazy=").append(lazy) .append(", schema=").append(schema) .append(", initiatorId=").append(initiatorId) .append(", sql='").append(sql) diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 59fdfda0a8350..dfd6d9c3d9b10 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -273,7 +273,7 @@ public GridKernalContext kernalContext() { SqlFieldsQuery curQry = qry; while (curQry != null) { - QueryParserResult parsed = parser.parse(schemaName, curQry, true); + QueryParserResult parsed = parser.parse(schemaName, curQry, true, true); metas.addAll(parsed.parametersMeta()); @@ -286,7 +286,7 @@ public GridKernalContext kernalContext() { /** {@inheritDoc} */ @Override public List resultMetaData(String schemaName, SqlFieldsQuery qry) throws IgniteSQLException { - QueryParserResult parsed = parser.parse(schemaName, qry, true); + QueryParserResult parsed = parser.parse(schemaName, qry, true, true); if (parsed.remainingQuery() != null) return null; @@ -355,7 +355,6 @@ public GridKernalContext kernalContext() { null, null, false, - false, false ); @@ -563,7 +562,6 @@ private long streamQuery0(String qry, String schemaName, IgniteDataStreamer stre null, qryInitiatorId, false, - false, false ); @@ -632,7 +630,7 @@ private Iterator> updateQueryRows(long qryId, String schemaName, UpdateP .setArgs(params) .setLocal(true); - QueryParserResult selectParseRes = parser.parse(schemaName, selectQry, false); + QueryParserResult selectParseRes = parser.parse(schemaName, selectQry, true, false); GridQueryFieldsResult res = executeSelectLocal( qryId, @@ -658,7 +656,7 @@ private Iterator> updateQueryRows(long qryId, String schemaName, UpdateP * @return DML. */ private QueryParserResultDml streamerParse(String schemaName, String qry) { - QueryParserResult parseRes = parser.parse(schemaName, new SqlFieldsQuery(qry), false); + QueryParserResult parseRes = parser.parse(schemaName, new SqlFieldsQuery(qry), true, false); QueryParserResultDml dml = parseRes.dml(); @@ -943,7 +941,7 @@ private void checkClusterState() { try (TraceSurroundings ignored = MTC.supportContinual(qrySpan)) { // Parse. - QueryParserResult parseRes = parser.parse(schemaName, remainingQry, !failOnMultipleStmts); + QueryParserResult parseRes = parser.parse(schemaName, remainingQry, true, !failOnMultipleStmts); qrySpan.addTag(SQL_QRY_TEXT, () -> parseRes.queryDescriptor().sql()); @@ -1197,10 +1195,11 @@ private QueryCursorImpl> executeSelectForDml( long qryId, String schema, SqlFieldsQuery selectQry, + boolean lazy, GridQueryCancel cancel, int timeout ) { - QueryParserResult parseRes = parser.parse(schema, selectQry, false); + QueryParserResult parseRes = parser.parse(schema, selectQry, lazy, false); QueryParserResultSelect select = parseRes.select(); @@ -1320,7 +1319,6 @@ private long registerRunningQuery( cancel, qryDesc.queryInitiatorId(), qryDesc.enforceJoinOrder(), - qryParams.lazy(), qryDesc.distributedJoins() ); @@ -1475,7 +1473,7 @@ public UpdateResult executeUpdateOnDataNode( GridQueryCancel cancel, boolean loc ) throws IgniteCheckedException { - QueryParserResult parseRes = parser.parse(schemaName, qry, false); + QueryParserResult parseRes = parser.parse(schemaName, qry, true, false); assert parseRes.remainingQuery() == null; @@ -1496,7 +1494,7 @@ public UpdateResult executeUpdateOnDataNode( /** {@inheritDoc} */ @Override public boolean isStreamableInsertStatement(String schemaName, SqlFieldsQuery qry) throws SQLException { - QueryParserResult parsed = parser.parse(schemaName, qry, true); + QueryParserResult parsed = parser.parse(schemaName, qry, true, true); return parsed.isDml() && parsed.dml().streamable() && parsed.remainingQuery() == null; } @@ -2207,12 +2205,7 @@ private UpdateResult executeUpdate0( .setEnforceJoinOrder(qryDesc.enforceJoinOrder()) .setLocal(qryDesc.local()) .setPageSize(qryParams.pageSize()) - .setTimeout(qryParams.timeout(), TimeUnit.MILLISECONDS) - // We cannot use lazy mode when UPDATE query contains updated columns - // in WHERE condition because it may be cause of update one entry several times - // (when index for such columns is selected for scan): - // e.g. : UPDATE test SET val = val + 1 WHERE val >= ? - .setLazy(qryParams.lazy() && plan.canSelectBeLazy()); + .setTimeout(qryParams.timeout(), TimeUnit.MILLISECONDS); Iterable> cur; @@ -2225,6 +2218,7 @@ private UpdateResult executeUpdate0( qryId, qryDesc.schemaName(), selectFieldsQry, + plan.canSelectBeLazy(), selectCancel, qryParams.timeout() ); @@ -2242,7 +2236,8 @@ else if (plan.hasRows()) { else { selectFieldsQry.setLocal(true); - QueryParserResult selectParseRes = parser.parse(qryDesc.schemaName(), selectFieldsQry, false); + QueryParserResult selectParseRes = parser.parse(qryDesc.schemaName(), + selectFieldsQry, plan.canSelectBeLazy(), false); final GridQueryFieldsResult res = executeSelectLocal( qryId, diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java index 5eb4c93872fae..dfa8e3ccc9259 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java @@ -128,12 +128,13 @@ public QueryParser(IgniteH2Indexing idx, ConnectionManager connMgr, Predicate batchedArgs = null; @@ -168,7 +170,7 @@ public QueryParameters queryParameters(SqlFieldsQuery qry) { qry.getArgs(), qry.getPartitions(), timeout, - qry.isLazy(), + lazy, qry.getPageSize(), null, autoCommit, @@ -183,9 +185,10 @@ public QueryParameters queryParameters(SqlFieldsQuery qry) { * @param schemaName schema name. * @param qry query to parse. * @param remainingAllowed Whether multiple statements are allowed. + * @param lazy Lazy query flag. * @return Parsing result that contains Parsed leading query and remaining sql script. */ - private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean remainingAllowed) { + private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean lazy, boolean remainingAllowed) { QueryDescriptor qryDesc = queryDescriptor(schemaName, qry); QueryParserCacheEntry cached = cache.get(qryDesc); @@ -197,7 +200,7 @@ private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean return new QueryParserResult( qryDesc, - queryParameters(qry), + queryParameters(qry, lazy), null, cached.parametersMeta(), cached.select(), @@ -215,7 +218,7 @@ private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean // Otherwise parse with H2. if (parseRes == null) - parseRes = parseH2(schemaName, qry, qryDesc.batched(), remainingAllowed); + parseRes = parseH2(schemaName, qry, lazy, qryDesc.batched(), remainingAllowed); // Add to cache if not multi-statement. if (parseRes.remainingQuery() == null) { @@ -271,7 +274,7 @@ private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean return new QueryParserResult( newPlanKey, - queryParameters(newQry), + queryParameters(newQry, true), remainingQry, Collections.emptyList(), // Currently none of native statements supports parameters. null, @@ -310,7 +313,7 @@ private QueryParserResult parse0(String schemaName, SqlFieldsQuery qry, boolean * @return Parsing result. */ @SuppressWarnings("IfMayBeConditional") - private QueryParserResult parseH2(String schemaName, SqlFieldsQuery qry, boolean batched, + private QueryParserResult parseH2(String schemaName, SqlFieldsQuery qry, boolean lazy, boolean batched, boolean remainingAllowed) { try (H2PooledConnection c = connMgr.connection(schemaName)) { // For queries that are explicitly local, we rely on the flag specified in the query @@ -406,7 +409,7 @@ private QueryParserResult parseH2(String schemaName, SqlFieldsQuery qry, boolean return new QueryParserResult( newQryDesc, - queryParameters(newQry), + queryParameters(newQry, lazy), remainingQry, paramsMeta, null, @@ -419,7 +422,7 @@ else if (CommandProcessor.isCommandNoOp(prepared)) { return new QueryParserResult( newQryDesc, - queryParameters(newQry), + queryParameters(newQry, lazy), remainingQry, paramsMeta, null, @@ -432,7 +435,7 @@ else if (GridSqlQueryParser.isDml(prepared)) { return new QueryParserResult( newQryDesc, - queryParameters(newQry), + queryParameters(newQry, lazy), remainingQry, paramsMeta, null, @@ -507,7 +510,7 @@ else if (!prepared.isQuery()) { return new QueryParserResult( newQryDesc, - queryParameters(newQry), + queryParameters(newQry, lazy), remainingQry, paramsMeta, select, diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java index ecd5673807cf6..d85c4e8a5d81c 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java @@ -522,6 +522,11 @@ public boolean isLocalSubquery() { } /** + * We cannot use lazy mode when UPDATE query contains updated columns + * in WHERE condition because it may be cause of update one entry several times + * (when index for such columns is selected for scan): + * e.g. : UPDATE test SET val = val + 1 WHERE val >= ? + * * @return {@code true} is the SELECT query may be executed in lazy mode. */ public boolean canSelectBeLazy() { diff --git a/modules/indexing/src/test/java/org/apache/ignite/client/FunctionalQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/client/FunctionalQueryTest.java index 091b95c103ae4..9538b375e2ce6 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/client/FunctionalQueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/client/FunctionalQueryTest.java @@ -114,8 +114,7 @@ public void testQueries() throws Exception { } } - checkSqlFieldsQuery(cache, minId, pageSize, expSize, exp, true); - checkSqlFieldsQuery(cache, minId, pageSize, expSize, exp, false); + checkSqlFieldsQuery(cache, minId, pageSize, expSize, exp); } } @@ -125,14 +124,12 @@ public void testQueries() throws Exception { * @param pageSize Page size. * @param expSize The size of the expected results. * @param exp Expected results. - * @param lazy Lazy mode flag. */ private void checkSqlFieldsQuery(ClientCache cache, int minId, int pageSize, int expSize, - Map exp, boolean lazy) { + Map exp) { SqlFieldsQuery qry = new SqlFieldsQuery("select id, name from Person where id >= ?") .setArgs(minId) - .setPageSize(pageSize) - .setLazy(lazy); + .setPageSize(pageSize); try (QueryCursor> cur = cache.query(qry)) { List> res = cur.getAll(); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java index e5f957cb5b0c8..c942843f59a90 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/SqlStatisticsUserQueriesFastTest.java @@ -280,22 +280,13 @@ public void testLocalSelectSuccess() { "success"); } - /** - * Check general failure metric if local select failed. - * - */ + /** Check general failure metric if local select failed. */ @Test public void testLocalSelectFailed() { - // Lazy query fails on `getAll`. - // `getAll' don't wrap IgniteSQLException with CacheException. - Class expErr = GridTestUtils.getFieldValue(SqlFieldsQuery.class, "DFLT_LAZY") - ? IgniteSQLException.class - : CacheException.class; - assertMetricsIncrementedOnlyOnReducer(() -> GridTestUtils.assertThrows( log, () -> cache.query(new SqlFieldsQuery("SELECT * FROM TAB WHERE ID = failFunction()").setLocal(true)).getAll(), - expErr, + IgniteSQLException.class, null), "failed"); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLazyQueryPartitionsReleaseTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryPartitionsReleaseTest.java similarity index 94% rename from modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLazyQueryPartitionsReleaseTest.java rename to modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryPartitionsReleaseTest.java index 159092c0bf5e4..6bc7c4f543cd1 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLazyQueryPartitionsReleaseTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryPartitionsReleaseTest.java @@ -38,9 +38,9 @@ import org.junit.Test; /** - * Test to lazy query partitions has not been released too early. + * Test to query partitions has not been released too early. */ -public class GridCacheLazyQueryPartitionsReleaseTest extends GridCommonAbstractTest { +public class GridCacheQueryPartitionsReleaseTest extends GridCommonAbstractTest { /** Cache name */ private static final String PERSON_CACHE = "person"; @@ -69,12 +69,12 @@ public class GridCacheLazyQueryPartitionsReleaseTest extends GridCommonAbstractT } /** - * Lazy query release partitions test. + * Query release partitions test. * * @throws Exception If failed. */ @Test - public void testLazyQueryPartitionsRelease() throws Exception { + public void testQueryPartitionsRelease() throws Exception { Ignite node1 = startGrid(0); IgniteCache cache = node1.cache(PERSON_CACHE); @@ -117,12 +117,12 @@ public void testLazyQueryPartitionsRelease() throws Exception { } /** - * Lazy query release partitions on cursor close test. + * Query release partitions on cursor close test. * * @throws Exception If failed. */ @Test - public void testLazyQueryPartitionsReleaseOnClose() throws Exception { + public void testQueryPartitionsReleaseOnClose() throws Exception { Ignite node1 = startGrid(0); IgniteCache cache = node1.cache(PERSON_CACHE); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java index 224e65b7e3c2d..8a7068ea93006 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2ConnectionLeaksSelfTest.java @@ -252,6 +252,6 @@ private void startGridAndPopulateCache(int nodes) throws Exception { /** */ private List> sql(IgniteEx ign, String sql, Object... params) { - return ign.context().query().querySqlFields(new SqlFieldsQuery(sql).setLazy(true).setArgs(params), false).getAll(); + return ign.context().query().querySqlFields(new SqlFieldsQuery(sql).setArgs(params), false).getAll(); } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/CreateIndexOnInvalidDataTypeTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/CreateIndexOnInvalidDataTypeTest.java index e92e609d97662..017ae91df88e9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/CreateIndexOnInvalidDataTypeTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/CreateIndexOnInvalidDataTypeTest.java @@ -177,7 +177,6 @@ public void testAddInvalidDataToIndex() throws Exception { */ private FieldsQueryCursor> sql(String sql, Object... args) { return grid().context().query().querySqlFields(new SqlFieldsQuery(sql) - .setLazy(true) .setArgs(args), false); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOffTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOffTest.java deleted file mode 100644 index eabb0765625f0..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOffTest.java +++ /dev/null @@ -1,29 +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.ignite.internal.processors.query; - -/** - * Tests for query execution with disabled lazy mode. - */ -public class IgniteQueryTableLockAndConnectionPoolLazyModeOffTest - extends AbstractQueryTableLockAndConnectionPoolSelfTest { - /** {@inheritDoc} */ - @Override protected boolean lazy() { - return false; - } -} diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOnTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOnTest.java deleted file mode 100644 index 10278808dee85..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolLazyModeOnTest.java +++ /dev/null @@ -1,29 +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.ignite.internal.processors.query; - -/** - * Tests for lazy query execution. - */ -public class IgniteQueryTableLockAndConnectionPoolLazyModeOnTest - extends AbstractQueryTableLockAndConnectionPoolSelfTest { - /** {@inheritDoc} */ - @Override protected boolean lazy() { - return true; - } -} diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractQueryTableLockAndConnectionPoolSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolSelfTest.java similarity index 95% rename from modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractQueryTableLockAndConnectionPoolSelfTest.java rename to modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolSelfTest.java index 4090f1f1223aa..aad2e68cff856 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractQueryTableLockAndConnectionPoolSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteQueryTableLockAndConnectionPoolSelfTest.java @@ -49,7 +49,7 @@ /** * Tests for query execution check cases for correct table lock/unlock. */ -public abstract class AbstractQueryTableLockAndConnectionPoolSelfTest extends AbstractIndexingCommonTest { +public class IgniteQueryTableLockAndConnectionPoolSelfTest extends AbstractIndexingCommonTest { /** Keys count. */ private static final int KEY_CNT = 500; @@ -292,17 +292,10 @@ public void testFetchFromRemovedTable() throws Exception { while (it.hasNext()) it.next(); - if (lazy()) - fail("Retry exception must be thrown"); + fail("Retry exception must be thrown"); } catch (Exception e) { - if (!lazy()) { - log.error("In lazy=false mode the query must be finished successfully", e); - - fail("In lazy=false mode the query must be finished successfully"); - } - else - assertNotNull(X.cause(e, QueryRetryException.class)); + assertNotNull(X.cause(e, QueryRetryException.class)); } } @@ -327,7 +320,6 @@ private void checkTablesLockQueryAndDDLMultithreaded(final Ignite node) throws E "JOIN \"pers\".PERSON p on p.id = pers.id " + "JOIN (SELECT t.persId as persId, SUM(t.time) totalTime " + "FROM \"persTask\".PersonTask as t GROUP BY t.persId) as task ON task.persId = pers.id", true) - .setLazy(lazy()) .setLocal(local) .setPageSize(PAGE_SIZE_SMALL)); @@ -339,11 +331,6 @@ private void checkTablesLockQueryAndDDLMultithreaded(final Ignite node) throws E fail("Unexpected exception. " + e); } - else if (!lazy()) { - log.error("Unexpected exception", e); - - fail("Unexpected QueryRetryException."); - } } } } @@ -379,7 +366,6 @@ private void checkTablesLockQueryAndDropColumnMultithreaded(final Ignite node) t try { FieldsQueryCursor> cursor = execute(node, new SqlFieldsQuery( "SELECT pers.id, pers.name FROM \"pers\".PERSON") - .setLazy(lazy()) .setPageSize(PAGE_SIZE_SMALL)); cursor.getAll(); @@ -393,11 +379,6 @@ else if (X.cause(e, QueryRetryException.class) == null) { fail("Unexpected exception. " + e); } - else if (!lazy()) { - log.error("Unexpected exception", e); - - fail("Unexpected QueryRetryException."); - } } } } @@ -434,8 +415,7 @@ private void checkTablesLockQueryAndDropTable(final Ignite node) throws Exceptio while (!end.get()) { try { FieldsQueryCursor> cursor = execute(node, new SqlFieldsQuery( - "SELECT * FROM TEST") - .setLazy(lazy())); + "SELECT * FROM TEST")); cursor.getAll(); } @@ -469,11 +449,6 @@ else if (X.cause(e, QueryRetryException.class) == null) { fail("Unexpected exception. " + e); } - else if (!lazy()) { - log.error("Unexpected exception", e); - - fail("Unexpected QueryRetryException."); - } } } } @@ -620,11 +595,10 @@ private void checkBaseOperations(Ignite node) throws Exception { while (it.hasNext()) rows.add(it.next()); - if (lazy()) - fail("Retry exception must be thrown"); + fail("Retry exception must be thrown"); } catch (Exception e) { - if (!lazy() || X.cause(e, QueryRetryException.class) == null) { + if (X.cause(e, QueryRetryException.class) == null) { log.error("Invalid exception: ", e); fail("QueryRetryException is expected"); @@ -876,7 +850,7 @@ private static IgniteCache cache(Ignite node, String name) { * @return Cursor. */ private FieldsQueryCursor> execute(Ignite node, String sql) { - return ((IgniteEx)node).context().query().querySqlFields(new SqlFieldsQuery(sql).setLazy(lazy()), false); + return ((IgniteEx)node).context().query().querySqlFields(new SqlFieldsQuery(sql), false); } /** @@ -887,14 +861,9 @@ private FieldsQueryCursor> execute(Ignite node, String sql) { * @return Cursor. */ private FieldsQueryCursor> execute(Ignite node, SqlFieldsQuery qry) { - return ((IgniteEx)node).context().query().querySqlFields(qry.setLazy(lazy()), false); + return ((IgniteEx)node).context().query().querySqlFields(qry, false); } - /** - * @return Lazy mode. - */ - protected abstract boolean lazy(); - /** * Get name for ID. * diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaTest.java index 2e4ae1b372494..f709d0dbe48b0 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaTest.java @@ -27,7 +27,7 @@ public class IgniteSqlCustomSchemaTest extends AbstractCustomSchemaTest { /** {@inheritDoc} */ @Override protected List> execSql(String qry) { return grid(0).context().query() - .querySqlFields(new SqlFieldsQuery(qry).setLazy(true), false) + .querySqlFields(new SqlFieldsQuery(qry), false) .getAll(); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java index a0cb060ba4380..1ad2fb2a8c75c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java @@ -146,7 +146,7 @@ private IgniteEx startAndActivate() throws Exception { /** */ private List> execSql(String qry) { return grid(0).context().query() - .querySqlFields(new SqlFieldsQuery(qry).setLazy(true), false) + .querySqlFields(new SqlFieldsQuery(qry), false) .getAll(); } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlDefaultSchemaTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlDefaultSchemaTest.java index 7334e4b087dbb..980ef21d40953 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlDefaultSchemaTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlDefaultSchemaTest.java @@ -25,7 +25,7 @@ public class IgniteSqlDefaultSchemaTest extends AbstractDefaultSchemaTest { /** {@inheritDoc} */ @Override protected List> execSql(String qry) { return grid(0).context().query() - .querySqlFields(new SqlFieldsQuery(qry).setLazy(true), false) + .querySqlFields(new SqlFieldsQuery(qry), false) .getAll(); } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java index 7721865911905..0446c2742123f 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java @@ -91,7 +91,7 @@ private IgniteConfiguration createTestConf(String nodeName, String schemaName, S /** */ protected List> execSql(String ignName, String qry) { return grid(ignName).context().query() - .querySqlFields(new SqlFieldsQuery(qry).setLazy(true), false) + .querySqlFields(new SqlFieldsQuery(qry), false) .getAll(); } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryErrorOnCancelTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryErrorOnCancelTest.java index 1cf5b62707cec..b655bd5cca6e6 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryErrorOnCancelTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryErrorOnCancelTest.java @@ -113,12 +113,11 @@ public class KillQueryErrorOnCancelTest extends GridCommonAbstractTest { * */ @Test - public void testCancelAfterIteratorObtainedLazy() throws Exception { + public void testCancelAfterIteratorObtained() throws Exception { IgniteEx node = grid(0); FieldsQueryCursor> cur = node.context().query() .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer ORDER BY _val") - .setLazy(true) .setPageSize(1), false); Iterator> it = cur.iterator(); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java index 48b1d907e5396..974326c729b48 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java @@ -636,7 +636,7 @@ public void testCancelQuery() throws Exception { @Test public void testCancelBeforeIteratorObtained() throws Exception { FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(false), false); + .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer"), false); Long qryId = ignite.context().query().runningQueries(-1).iterator().next().id(); @@ -653,7 +653,7 @@ public void testCancelBeforeIteratorObtained() throws Exception { @Test public void testCancelAfterIteratorObtained() throws Exception { FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(false), false); + .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer"), false); cur.iterator(); @@ -672,64 +672,7 @@ public void testCancelAfterIteratorObtained() throws Exception { @Test public void testCancelAfterResultSetPartiallyRead() throws Exception { FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(false), false); - - Iterator> it = cur.iterator(); - - it.next(); - - Long qryId = ignite.context().query().runningQueries(-1).iterator().next().id(); - - igniteForKillRequest.context().query() - .querySqlFields(createKillQuery(ignite.context().localNodeId(), qryId, asyncCancel), false).getAll(); - - if (asyncCancel) - GridTestUtils.waitForCondition(() -> ignite.context().query().runningQueries(-1).isEmpty(), 1000); - } - - /** - * - */ - @Test - public void testCancelBeforeIteratorObtainedLazy() throws Exception { - FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(true), false); - - Long qryId = ignite.context().query().runningQueries(-1).iterator().next().id(); - - igniteForKillRequest.context().query() - .querySqlFields(createKillQuery(ignite.context().localNodeId(), qryId, asyncCancel), false).getAll(); - - if (asyncCancel) - GridTestUtils.waitForCondition(() -> ignite.context().query().runningQueries(-1).isEmpty(), 1000); - } - - /** - * - */ - @Test - public void testCancelAfterIteratorObtainedLazy() throws Exception { - FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(true), false); - - cur.iterator(); - - Long qryId = ignite.context().query().runningQueries(-1).iterator().next().id(); - - igniteForKillRequest.context().query() - .querySqlFields(createKillQuery(ignite.context().localNodeId(), qryId, asyncCancel), false).getAll(); - - if (asyncCancel) - GridTestUtils.waitForCondition(() -> ignite.context().query().runningQueries(-1).isEmpty(), 1000); - } - - /** - * - */ - @Test - public void testCancelAfterResultSetPartiallyReadLazy() throws Exception { - FieldsQueryCursor> cur = ignite.context().query() - .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer").setLazy(true), false); + .querySqlFields(new SqlFieldsQuery("select * from \"default\".Integer"), false); Iterator> it = cur.iterator(); @@ -780,30 +723,6 @@ public void testCancelLocalQueryNative() throws Exception { new SqlFieldsQuery("select * from Integer where _key in " + "(select _key from Integer where awaitLatchCancelled() = 0) and shouldNotBeCalledMoreThan(128)") .setLocal(true) - .setLazy(false) - ).getAll(); - - return null; - }, QueryCancelledException.class, "The query was cancelled while executing."); - - // Ensures that there were no exceptions within async cancellation process. - cancelRes.get(CHECK_RESULT_TIMEOUT); - } - - /** - * Check that local query can be canceled either using async or non-async method. Local query is performed using - * cache.query() API with "local" property "true". - */ - @Test - public void testCancelLocalLazyQueryNative() throws Exception { - IgniteInternalFuture cancelRes = cancel(1, asyncCancel); - - GridTestUtils.assertThrowsAnyCause(log, () -> { - ignite.cache(DEFAULT_CACHE_NAME).query( - new SqlFieldsQuery("select * from Integer where _key in " + - "(select _key from Integer where awaitLatchCancelled() = 0) and shouldNotBeCalledMoreThan(128)") - .setLocal(true) - .setLazy(true) ).getAll(); return null; diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LazyOnDmlTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LazyOnDmlTest.java index 0690cb3c0d005..abd6d27862af3 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LazyOnDmlTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LazyOnDmlTest.java @@ -282,7 +282,6 @@ private FieldsQueryCursor> sql(String sql, Object... args) { */ private FieldsQueryCursor> sql(IgniteEx ign, String sql, Object... args) { return ign.context().query().querySqlFields(new SqlFieldsQuery(sql) - .setLazy(true) .setSchema("TEST") .setPageSize(1) .setArgs(args), false); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryTest.java similarity index 95% rename from modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java rename to modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryTest.java index c9aa7937263db..93380a9c0f924 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryLazyTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LocalQueryTest.java @@ -38,9 +38,9 @@ import org.junit.Test; /** - * Tests for local query execution in lazy mode. + * Tests for local query execution. */ -public class LocalQueryLazyTest extends AbstractIndexingCommonTest { +public class LocalQueryTest extends AbstractIndexingCommonTest { /** Keys count. */ private static final int KEY_CNT = 10; @@ -87,7 +87,7 @@ public class LocalQueryLazyTest extends AbstractIndexingCommonTest { * Test local query execution. */ @Test - public void testLocalLazyQuery() { + public void testLocalQuery() { Iterator[] iters = new Iterator[QRY_CNT]; for (int i = 0; i < QRY_CNT; ++i) { @@ -106,7 +106,7 @@ public void testLocalLazyQuery() { } /** - * Test use valid query context for local lazy queries. + * Test use valid query context for local queries. * @throws Exception On error. */ @Test @@ -160,7 +160,6 @@ public void testDropTableWithOpenCursor() throws Exception { final Iterator> it = grid().context().query().querySqlFields(new SqlFieldsQuery("SELECT * FROM TBL0") .setLocal(true) - .setLazy(true) .setSchema("TEST") .setPageSize(1), false).iterator(); @@ -184,7 +183,6 @@ public void testDeactivateWithOpenCursor() throws Exception { final Iterator> it = grid().context().query().querySqlFields(new SqlFieldsQuery("SELECT * FROM test") .setLocal(true) - .setLazy(true) .setSchema("TEST") .setPageSize(1), false).iterator(); @@ -213,7 +211,6 @@ private FieldsQueryCursor> sql(String sql, Object... args) { private FieldsQueryCursor> sql(IgniteEx ign, String sql, Object... args) { return ign.context().query().querySqlFields(new SqlFieldsQuery(sql) .setLocal(true) - .setLazy(true) .setSchema("TEST") .setArgs(args), false); } @@ -226,7 +223,6 @@ private FieldsQueryCursor> sql(IgniteEx ign, String sql, Object... args) */ private FieldsQueryCursor> sqlDistrubuted(IgniteEx ign, String sql, Object... args) { return ign.context().query().querySqlFields(new SqlFieldsQuery(sql) - .setLazy(true) .setSchema("TEST") .setArgs(args), false); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java index a46f489cae30b..bf9ca2cddf9d9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/LongRunningQueryTest.java @@ -39,7 +39,6 @@ import org.apache.ignite.cache.QueryEntity; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.cache.query.FieldsQueryCursor; -import org.apache.ignite.cache.query.QueryCancelledException; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.cache.query.annotations.QuerySqlField; import org.apache.ignite.cache.query.annotations.QuerySqlFunction; @@ -77,8 +76,8 @@ public class LongRunningQueryTest extends AbstractIndexingCommonTest { /** Keys count. */ private static final int KEY_CNT = 1000; - /** Number of keys to be queries in lazy queries. */ - private static final int LAZY_QRYS_KEY_CNT = 5; + /** Number of keys to be queries in queries. */ + private static final int QRYS_KEY_CNT = 5; /** Long query warning timeout. */ private static final int LONG_QUERY_WARNING_TIMEOUT = 1000; @@ -125,9 +124,6 @@ public class LongRunningQueryTest extends AbstractIndexingCommonTest { /** Local query mode. */ private boolean local; - /** Lazy query mode. */ - private boolean lazy; - /** Merge table usage flag. */ private boolean withMergeTable; @@ -194,37 +190,12 @@ private static CacheConfiguration cacheConfig(String name, Class... idxTypes) .setSqlFunctionClasses(TestSQLFunctions.class); } - /** - * - */ - @Test - public void testLongDistributed() { - local = false; - lazy = false; - - checkLongRunning(); - checkFastQueries(); - } - - /** - * - */ - @Test - public void testLongLocal() { - local = true; - lazy = false; - - checkLongRunning(); - checkFastQueries(); - } - /** * */ @Test public void testLongDistributedLazy() { local = false; - lazy = true; checkLongRunning(); checkFastQueries(); @@ -236,7 +207,6 @@ public void testLongDistributedLazy() { @Test public void testLongDistributedLazyWithMergeTable() { local = false; - lazy = true; withMergeTable = true; @@ -254,7 +224,6 @@ public void testLongDistributedLazyWithMergeTable() { @Test public void testLongLocalLazy() { local = true; - lazy = true; checkLongRunning(); checkFastQueries(); @@ -363,7 +332,6 @@ public void testLongRunningDeleteWithSubqueryLocal() { @Test public void testDistributedLazyWithExternalWait() { local = false; - lazy = true; checkLazyWithExternalWait(); } @@ -375,7 +343,6 @@ public void testDistributedLazyWithExternalWait() { @Test public void testlocalLazyWithExternalWait() { local = true; - lazy = true; checkLazyWithExternalWait(); } @@ -406,7 +373,6 @@ public void testCorrectThreadName() { @Test public void testBigResultSetLocal() throws Exception { local = true; - lazy = true; checkBigResultSet(); } @@ -417,7 +383,6 @@ public void testBigResultSetLocal() throws Exception { @Test public void testBigResultDistributed() throws Exception { local = false; - lazy = true; checkBigResultSet(); } @@ -618,18 +583,10 @@ private void checkBigResultSet() throws Exception { * @param args Query parameters. */ private void sqlCheckLongRunning(String sql, Object... args) { - GridTestUtils.assertThrowsAnyCause(log, () -> sql("test", sql, args).getAll(), QueryCancelledException.class, ""); - } - - /** - * @param sql SQL query. - * @param args Query parameters. - */ - private void sqlCheckLongRunningLazy(String sql, Object... args) { pageSize = 1; try { - assertEquals(LAZY_QRYS_KEY_CNT, sql("test", sql, args).getAll().size()); + assertEquals(QRYS_KEY_CNT, sql("test", sql, args).getAll().size()); } finally { pageSize = DEFAULT_PAGE_SIZE; @@ -640,7 +597,7 @@ private void sqlCheckLongRunningLazy(String sql, Object... args) { * @param sql SQL query. * @param args Query parameters. */ - private void sqlCheckLongRunningLazyWithMergeTable(String sql, Object... args) { + private void sqlCheckLongRunningWithMergeTable(String sql, Object... args) { distributedJoins = true; try { @@ -667,18 +624,16 @@ private void sqlCheckLongRunningLazyWithMergeTable(String sql, Object... args) { * Execute long-running sql with a check for errors. */ private void sqlCheckLongRunning() { - if (lazy && withMergeTable) { + if (withMergeTable) { String select = "select o.name n1, p.name n2 from Person p, \"org\".Organization o" + " where p.orgId = o._key and o._key=1 and o._key < sleep_func(?, ?)" + " union select o.name n1, p.name n2 from Person p, \"org\".Organization o" + " where p.orgId = o._key and o._key=2"; - sqlCheckLongRunningLazyWithMergeTable(select, 2000, LAZY_QRYS_KEY_CNT); + sqlCheckLongRunningWithMergeTable(select, 2000, QRYS_KEY_CNT); } - else if (lazy && !withMergeTable) - sqlCheckLongRunningLazy("SELECT * FROM test WHERE _key < sleep_func(?, ?)", 2000, LAZY_QRYS_KEY_CNT); else - sqlCheckLongRunning("SELECT T0.id FROM test AS T0, test AS T1, test AS T2 where T0.id > ?", 0); + sqlCheckLongRunning("SELECT * FROM test WHERE _key < sleep_func(?, ?)", 2000, QRYS_KEY_CNT); } /** @@ -691,7 +646,6 @@ private FieldsQueryCursor> sql(String cacheName, String sql, Object... a return ignite.cache(cacheName).query(new SqlFieldsQuery(sql) .setTimeout(10, TimeUnit.SECONDS) .setLocal(local) - .setLazy(lazy) .setPageSize(pageSize) .setDistributedJoins(distributedJoins) .setArgs(args)); @@ -736,8 +690,6 @@ public void checkLazyWithExternalWait() { * @param dml Dml command. */ public void runDml(String dml) { - lazy = false; - long start = U.currentTimeMillis(); sql("test", dml); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/ReducerRowsBufferTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/ReducerRowsBufferTest.java index 95435e24d36b4..ee5c60f00c788 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/ReducerRowsBufferTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/ReducerRowsBufferTest.java @@ -20,7 +20,6 @@ import java.util.Iterator; import java.util.List; import java.util.UUID; - import org.apache.ignite.cache.query.FieldsQueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.processors.cache.QueryCursorImpl; @@ -55,7 +54,7 @@ public class ReducerRowsBufferTest extends GridCommonAbstractTest { /** */ @Test public void plainQuery() { - Iterator> it = query("select * from TEST", true).iterator(); + Iterator> it = query("select * from TEST").iterator(); it.next(); @@ -104,10 +103,9 @@ private void execSql(String sql, Object... args) { * @param sql SQL query * @return Results set. */ - FieldsQueryCursor> query(String sql, boolean lazy) { + FieldsQueryCursor> query(String sql) { return grid(0).context().query().querySqlFields( new SqlFieldsQueryEx(sql, null) - .setLazy(lazy) .setEnforceJoinOrder(true) .setPageSize(100), false); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java index 0f424a50d4416..f1f294ecaab4a 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/QueryDataPageScanTest.java @@ -341,7 +341,6 @@ private void checkLazySql(IgniteCache cache, Boolean dataPageSca "from TestData a use index(), TestData b use index() " + "where a.z between ? and ? " + "and check_scan_flag(?,true)") - .setLazy(true) .setArgs(1, expNestedLoops, DirectPageScanIndexing.expectedDataPageScanEnabled) .setPageSize(keysCnt / 10) // Must be less than keysCnt. ) diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java index ef5202aabd432..911c9b036dc2c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/oom/AbstractQueryOOMTest.java @@ -272,34 +272,15 @@ public void testHeavySortByNotIndexNotLazy() throws Exception { */ @Test public void testHeavyGroupByPkLazy() throws Exception { - checkQuery("SELECT id, sum(val) from test GROUP BY id", KEY_CNT, true, true); - } - - /** - * @throws Exception On error. - */ - @Ignore("https://issues.apache.org/jira/browse/IGNITE-9480") - @Test - public void testHeavyGroupByPkNotLazy() throws Exception { - checkQueryExpectOOM("SELECT id, sum(val) from test GROUP BY id", false, true); - } - - /** - * @param sql Query. - * @param lazy Lazy mode. - * @throws Exception On error. - */ - private void checkQueryExpectOOM(String sql, boolean lazy) throws Exception { - checkQueryExpectOOM(sql, lazy, false); + checkQuery("SELECT id, sum(val) from test GROUP BY id", KEY_CNT, true); } /** * @param sql Query. - * @param lazy Lazy mode. * @param collocated Collocated GROUP BY mode. * @throws Exception On error. */ - private void checkQueryExpectOOM(String sql, boolean lazy, boolean collocated) throws Exception { + private void checkQueryExpectOOM(String sql, boolean collocated) throws Exception { final AtomicBoolean hangTimeout = new AtomicBoolean(); final AtomicBoolean hangCheckerEnd = new AtomicBoolean(); @@ -327,7 +308,7 @@ private void checkQueryExpectOOM(String sql, boolean lazy, boolean collocated) t }); try { - checkQuery(sql, 0, lazy, collocated); + checkQuery(sql, 0, collocated); fail("Query is not produce OOM"); } @@ -355,25 +336,22 @@ else if (e.getMessage().contains("Failed to communicate with Ignite cluster")) /** * @param sql Query. * @param expectedRowCnt Expected row count. - * @param lazy Lazy mode. * @throws Exception On failure. */ - public void checkQuery(String sql, long expectedRowCnt, boolean lazy) throws Exception { - checkQuery(sql, expectedRowCnt, lazy, false); + public void checkQuery(String sql, long expectedRowCnt) throws Exception { + checkQuery(sql, expectedRowCnt, false); } /** * @param sql Query. * @param expectedRowCnt Expected row count. - * @param lazy Lazy mode. * @param collocated Collocated group by flag. * @throws Exception On failure. */ - public void checkQuery(String sql, long expectedRowCnt, boolean lazy, boolean collocated) throws Exception { + public void checkQuery(String sql, long expectedRowCnt, boolean collocated) throws Exception { try (Connection c = DriverManager.getConnection( "jdbc:ignite:thin://127.0.0.1:10800..10850/\"test_cache\"" + - "?collocated=" + collocated + - "&lazy=" + lazy)) { + "?collocated=" + collocated)) { try (Statement stmt = c.createStatement()) { log.info("Run heavy query: " + sql); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThickJavaTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThickJavaTest.java index ee6d6ff50a70c..9cdca72483bb5 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThickJavaTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThickJavaTest.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; - import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.testframework.GridTestUtils; @@ -33,33 +32,26 @@ */ @RunWith(Parameterized.class) public class DefaultQueryTimeoutThickJavaTest extends AbstractDefaultQueryTimeoutTest { - /** Lazy mode. */ - @Parameterized.Parameter(value = 0) - public boolean lazy; - /** Execute update queries. */ - @Parameterized.Parameter(value = 1) + @Parameterized.Parameter() public boolean update; /** Execute local queries. */ - @Parameterized.Parameter(value = 2) + @Parameterized.Parameter(1) public boolean local; /** */ - @Parameterized.Parameters(name = "lazy={0}, update={1}, local={2}") + @Parameterized.Parameters(name = "update={0}, local={1}") public static List parameters() { ArrayList params = new ArrayList<>(); boolean[] arrBool = new boolean[] {true, false}; + for (boolean update0 : arrBool) { + for (boolean local0 : arrBool) { + if (local0 && update0) + continue; - for (boolean lazy0 : arrBool) { - for (boolean update0 : arrBool) { - for (boolean local0 : arrBool) { - if (local0 && update0) - continue; - - params.add(new Object[] {lazy0, update0, local0}); - } + params.add(new Object[] {update0, local0}); } } @@ -97,7 +89,6 @@ public static List parameters() { /** */ private void executeQuery0(SqlFieldsQuery qry) throws Exception { - qry.setLazy(lazy); qry.setLocal(local); IgniteEx ign = local ? grid(0) : grid("cli"); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThinJdbcTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThinJdbcTest.java index bb3b8fc634d8c..bad6c0e605880 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThinJdbcTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/timeout/DefaultQueryTimeoutThinJdbcTest.java @@ -45,7 +45,11 @@ public class DefaultQueryTimeoutThinJdbcTest extends AbstractDefaultQueryTimeout stmt.timeout(timeout); - stmt.executeQuery(sql); + ResultSet set = stmt.executeQuery(sql); + + while (set.next()) { + // No-op. + } } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java index 90137635fbb0f..52385804374e7 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java @@ -17,16 +17,15 @@ package org.apache.ignite.testsuites; -import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.processors.cache.AffinityAliasKeyTest; import org.apache.ignite.internal.processors.cache.AffinityKeyNameAndValueFieldNameConflictTest; import org.apache.ignite.internal.processors.cache.CacheOffheapBatchIndexingMultiTypeTest; import org.apache.ignite.internal.processors.cache.CacheQueryBuildValueTest; import org.apache.ignite.internal.processors.cache.DdlTransactionIndexingSelfTest; import org.apache.ignite.internal.processors.cache.GridCacheCrossCacheQuerySelfTest; -import org.apache.ignite.internal.processors.cache.GridCacheLazyQueryPartitionsReleaseTest; import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest; import org.apache.ignite.internal.processors.cache.GridCacheQueryInternalKeysSelfTest; +import org.apache.ignite.internal.processors.cache.GridCacheQueryPartitionsReleaseTest; import org.apache.ignite.internal.processors.cache.GridCacheQuerySerializationSelfTest; import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectFieldsQuerySelfTest; import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectLocalQueryArgumentsTest; @@ -119,8 +118,7 @@ import org.apache.ignite.internal.processors.client.ClientConnectorConfigurationValidationSelfTest; import org.apache.ignite.internal.processors.database.baseline.IgniteStableBaselineBinObjFieldsQuerySelfTest; import org.apache.ignite.internal.processors.query.IgniteCachelessQueriesSelfTest; -import org.apache.ignite.internal.processors.query.IgniteQueryTableLockAndConnectionPoolLazyModeOffTest; -import org.apache.ignite.internal.processors.query.IgniteQueryTableLockAndConnectionPoolLazyModeOnTest; +import org.apache.ignite.internal.processors.query.IgniteQueryTableLockAndConnectionPoolSelfTest; import org.apache.ignite.internal.processors.query.IgniteSqlSchemaIndexingTest; import org.apache.ignite.internal.processors.query.IgniteSqlSegmentedIndexMultiNodeSelfTest; import org.apache.ignite.internal.processors.query.IgniteSqlSegmentedIndexSelfTest; @@ -155,8 +153,6 @@ import org.apache.ignite.sqltests.PartitionedSqlTest; import org.apache.ignite.sqltests.ReplicatedSqlCustomPartitionsTest; import org.apache.ignite.sqltests.ReplicatedSqlTest; -import org.apache.ignite.testframework.GridTestUtils; -import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -207,7 +203,7 @@ // Misc tests. QueryEntityValidationSelfTest.class, DuplicateKeyValueClassesSelfTest.class, - GridCacheLazyQueryPartitionsReleaseTest.class, + GridCacheQueryPartitionsReleaseTest.class, StopNodeOnRebuildIndexFailureTest.class, // Dynamic index create/drop tests. @@ -232,8 +228,7 @@ IgniteDynamicEnableIndexingRestoreTest.class, // Queries tests. - IgniteQueryTableLockAndConnectionPoolLazyModeOnTest.class, - IgniteQueryTableLockAndConnectionPoolLazyModeOffTest.class, + IgniteQueryTableLockAndConnectionPoolSelfTest.class, IgniteSqlSplitterSelfTest.class, SqlPushDownFunctionTest.class, IgniteSqlSegmentedIndexSelfTest.class, @@ -341,9 +336,4 @@ }) public class IgniteBinaryCacheQueryTestSuite { - /** Setup lazy mode default. */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", false); - } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java index a05e45f5db804..59d932043e533 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite2.java @@ -17,7 +17,6 @@ package org.apache.ignite.testsuites; -import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.processors.cache.CacheScanPartitionQueryFallbackSelfTest; import org.apache.ignite.internal.processors.cache.IgniteCacheCrossCacheJoinRandomTest; import org.apache.ignite.internal.processors.cache.IgniteCacheObjectKeyIndexingSelfTest; @@ -64,8 +63,6 @@ import org.apache.ignite.internal.processors.query.SqlTwoCachesInGroupWithSameEntryTest; import org.apache.ignite.internal.processors.query.WrongQueryEntityFieldTypeTest; import org.apache.ignite.internal.processors.query.timeout.DefaultQueryTimeoutTestSuite; -import org.apache.ignite.testframework.GridTestUtils; -import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -142,9 +139,4 @@ }) public class IgniteBinaryCacheQueryTestSuite2 { - /** Setup lazy mode default. */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", false); - } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java index 0b3a09df85774..36154c333db41 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite3.java @@ -17,7 +17,6 @@ package org.apache.ignite.testsuites; -import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexKeyTypeRegistryTest; import org.apache.ignite.internal.cdc.CacheEventsCdcTest; import org.apache.ignite.internal.cdc.CdcIndexRebuildTest; @@ -160,10 +159,8 @@ import org.apache.ignite.internal.sql.SqlParserUserSelfTest; import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest; import org.apache.ignite.spi.communication.tcp.H2CommunicationMessageSerializationTest; -import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.util.KillCommandsMXBeanTest; import org.apache.ignite.util.KillCommandsSQLTest; -import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -377,9 +374,4 @@ H2TransactionAwareQueriesEnabledTest.class, }) public class IgniteBinaryCacheQueryTestSuite3 { - /** Setup lazy mode default. */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", false); - } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java index d66430aecabf0..9247b96a862a5 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java +++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite4.java @@ -17,7 +17,6 @@ package org.apache.ignite.testsuites; -import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.metric.SqlStatisticsUserQueriesFastTest; import org.apache.ignite.internal.metric.SqlStatisticsUserQueriesLongTest; import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePartitionedTxMultiNodeSelfTest; @@ -28,7 +27,7 @@ import org.apache.ignite.internal.processors.cache.query.ScanQueryUpdateTtlTest; import org.apache.ignite.internal.processors.query.DmlBatchSizeDeadlockTest; import org.apache.ignite.internal.processors.query.IgniteSqlCreateTableTemplateTest; -import org.apache.ignite.internal.processors.query.LocalQueryLazyTest; +import org.apache.ignite.internal.processors.query.LocalQueryTest; import org.apache.ignite.internal.processors.query.LongRunningQueryTest; import org.apache.ignite.internal.processors.query.SqlAffinityCacheTest; import org.apache.ignite.internal.processors.query.SqlAffinityHistoryForDynamicallyCreatedCachesTest; @@ -46,8 +45,6 @@ import org.apache.ignite.internal.processors.query.h2.twostep.TableViewSubquerySelfTest; import org.apache.ignite.sqltests.SqlByteArrayTest; import org.apache.ignite.sqltests.SqlDataTypesCoverageTests; -import org.apache.ignite.testframework.GridTestUtils; -import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -75,7 +72,7 @@ IgniteSqlCreateTableTemplateTest.class, - LocalQueryLazyTest.class, + LocalQueryTest.class, LongRunningQueryTest.class, @@ -105,9 +102,4 @@ ScanQueryUpdateTtlTest.class, }) public class IgniteBinaryCacheQueryTestSuite4 { - /** Setup lazy mode default. */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", false); - } } diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite.java deleted file mode 100644 index 09915bb5bf53c..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite.java +++ /dev/null @@ -1,42 +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.ignite.testsuites.nightly; - -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.testframework.GridTestUtils; -import org.apache.ignite.testsuites.IgniteBinaryCacheQueryTestSuite; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for cache queries with lazy mode. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - IgniteBinaryCacheQueryTestSuite.class, -}) -public class IgniteBinaryCacheQueryLazyTestSuite { - /** - * Setup lazy mode default. - */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", true); - } -} diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite2.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite2.java deleted file mode 100644 index 164a72574272c..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite2.java +++ /dev/null @@ -1,42 +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.ignite.testsuites.nightly; - -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.testframework.GridTestUtils; -import org.apache.ignite.testsuites.IgniteBinaryCacheQueryTestSuite2; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for cache queries with lazy mode. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - IgniteBinaryCacheQueryTestSuite2.class, -}) -public class IgniteBinaryCacheQueryLazyTestSuite2 { - /** - * Setup lazy mode default. - */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", true); - } -} diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite3.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite3.java deleted file mode 100644 index 1f9be756ec2c8..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite3.java +++ /dev/null @@ -1,42 +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.ignite.testsuites.nightly; - -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.testframework.GridTestUtils; -import org.apache.ignite.testsuites.IgniteBinaryCacheQueryTestSuite3; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for cache queries with lazy mode. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - IgniteBinaryCacheQueryTestSuite3.class, -}) -public class IgniteBinaryCacheQueryLazyTestSuite3 { - /** - * Setup lazy mode default. - */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", true); - } -} diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite4.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite4.java deleted file mode 100644 index 31a6e5e37ef08..0000000000000 --- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/nightly/IgniteBinaryCacheQueryLazyTestSuite4.java +++ /dev/null @@ -1,42 +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.ignite.testsuites.nightly; - -import org.apache.ignite.cache.query.SqlFieldsQuery; -import org.apache.ignite.testframework.GridTestUtils; -import org.apache.ignite.testsuites.IgniteBinaryCacheQueryTestSuite4; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * Test suite for cache queries with lazy mode. - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({ - IgniteBinaryCacheQueryTestSuite4.class, -}) -public class IgniteBinaryCacheQueryLazyTestSuite4 { - /** - * Setup lazy mode default. - */ - @BeforeClass - public static void setupLazy() { - GridTestUtils.setFieldValue(SqlFieldsQuery.class, "DFLT_LAZY", true); - } -} diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h index 4a186abd3eced..e5314bfd0773a 100644 --- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h +++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h @@ -54,7 +54,6 @@ namespace ignite loc(false), distributedJoins(false), enforceJoinOrder(false), - lazy(true), args() { // No-op. @@ -73,7 +72,6 @@ namespace ignite loc(loc), distributedJoins(false), enforceJoinOrder(false), - lazy(true), args() { // No-op. @@ -91,7 +89,6 @@ namespace ignite loc(other.loc), distributedJoins(other.distributedJoins), enforceJoinOrder(other.enforceJoinOrder), - lazy(other.lazy), args() { args.reserve(other.args.size()); @@ -147,7 +144,6 @@ namespace ignite swap(loc, other.loc); swap(distributedJoins, other.distributedJoins); swap(enforceJoinOrder, other.enforceJoinOrder); - swap(lazy, other.lazy); swap(args, other.args); } } @@ -214,40 +210,6 @@ namespace ignite this->loc = loc; } - /** - * Gets lazy query execution flag. - * - * See SetLazy(bool) for more information. - * - * @return Lazy flag. - * @deprecated Deprecated for removal. Use the page size instead. - */ - bool IsLazy() const - { - return lazy; - } - - /** - * Sets lazy query execution flag. - * - * By default Ignite attempts to fetch the whole query result set to memory and send it to the client. - * For small and medium result sets this provides optimal performance and minimize duration of internal - * database locks, thus increasing concurrency. - * - * If result set is too big to fit in available memory this could lead to excessive GC pauses and even - * OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing - * memory consumption at the cost of moderate performance hit. - * - * Defaults to @c false, meaning that the whole result set is fetched to memory eagerly. - * - * @param lazy Lazy query execution flag. - * @deprecated Deprecated for removal. Use the page size instead. - */ - void SetLazy(bool lazy) - { - this->lazy = lazy; - } - /** * Checks if join order of tables if enforced. * @@ -378,7 +340,7 @@ namespace ignite writer.WriteBool(distributedJoins); writer.WriteBool(enforceJoinOrder); - writer.WriteBool(lazy); + writer.WriteBool(true); // Lazy flag. writer.WriteInt32(0); // Timeout, ms writer.WriteBool(false); // ReplicatedOnly writer.WriteBool(false); // Colocated @@ -411,9 +373,6 @@ namespace ignite /** Enforce join order flag. */ bool enforceJoinOrder; - /** Lazy flag. */ - bool lazy; - /** Arguments. */ std::vector args; }; diff --git a/modules/platforms/cpp/odbc-test/src/configuration_test.cpp b/modules/platforms/cpp/odbc-test/src/configuration_test.cpp index 1778f5b64bb66..d4566c3efde9b 100644 --- a/modules/platforms/cpp/odbc-test/src/configuration_test.cpp +++ b/modules/platforms/cpp/odbc-test/src/configuration_test.cpp @@ -42,7 +42,6 @@ namespace const bool testEnforceJoinOrder = true; const bool testReplicatedOnly = true; const bool testCollocated = true; - const bool testLazy = true; const bool testSkipReducerOnUpdate = true; const EngineMode::Type testEngineMode = EngineMode::H2; @@ -186,7 +185,6 @@ void CheckConnectionConfig(const Configuration& cfg) BOOST_CHECK_EQUAL(cfg.IsEnforceJoinOrder(), testEnforceJoinOrder); BOOST_CHECK_EQUAL(cfg.IsReplicatedOnly(), testReplicatedOnly); BOOST_CHECK_EQUAL(cfg.IsCollocated(), testCollocated); - BOOST_CHECK_EQUAL(cfg.IsLazy(), testLazy); BOOST_CHECK_EQUAL(cfg.IsSkipReducerOnUpdate(), testSkipReducerOnUpdate); BOOST_CHECK_EQUAL(cfg.GetEngineMode(), testEngineMode); @@ -209,7 +207,6 @@ void CheckConnectionConfig(const Configuration& cfg) << "distributed_joins=" << BoolToStr(testDistributedJoins) << ';' << "driver={" << testDriverName << "};" << "enforce_join_order=" << BoolToStr(testEnforceJoinOrder) << ';' - << "lazy=" << BoolToStr(testLazy) << ';' << "page_size=" << testPageSize << ';' << "query_engine=" << EngineMode::ToString(testEngineMode) << ';' << "replicated_only=" << BoolToStr(testReplicatedOnly) << ';' @@ -233,7 +230,6 @@ void CheckDsnConfig(const Configuration& cfg) BOOST_CHECK_EQUAL(cfg.IsEnforceJoinOrder(), false); BOOST_CHECK_EQUAL(cfg.IsReplicatedOnly(), false); BOOST_CHECK_EQUAL(cfg.IsCollocated(), false); - BOOST_CHECK_EQUAL(cfg.IsLazy(), false); BOOST_CHECK_EQUAL(cfg.IsSkipReducerOnUpdate(), false); BOOST_CHECK(cfg.GetAddresses().empty()); } @@ -252,7 +248,6 @@ BOOST_AUTO_TEST_CASE(CheckTestValuesNotEquealDefault) BOOST_CHECK_NE(testEnforceJoinOrder, Configuration::DefaultValue::enforceJoinOrder); BOOST_CHECK_NE(testReplicatedOnly, Configuration::DefaultValue::replicatedOnly); BOOST_CHECK_NE(testCollocated, Configuration::DefaultValue::collocated); - BOOST_CHECK_NE(testLazy, Configuration::DefaultValue::lazy); BOOST_CHECK_NE(testSkipReducerOnUpdate, Configuration::DefaultValue::skipReducerOnUpdate); BOOST_CHECK_NE(testEngineMode, Configuration::DefaultValue::engineMode); } @@ -264,7 +259,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringUppercase) std::stringstream constructor; constructor << "DRIVER={" << testDriverName << "};" - << "LAZY=" << BoolToStr(testLazy, false) << ';' << "ADDRESS=" << testAddressStr << ';' << "DISTRIBUTED_JOINS=" << BoolToStr(testDistributedJoins, false) << ';' << "ENFORCE_JOIN_ORDER=" << BoolToStr(testEnforceJoinOrder, false) << ';' @@ -289,7 +283,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringLowercase) std::stringstream constructor; constructor << "driver={" << testDriverName << "};" - << "lazy=" << BoolToStr(testLazy) << ';' << "address=" << testAddressStr << ';' << "page_size=" << testPageSize << ';' << "distributed_joins=" << BoolToStr(testDistributedJoins) << ';' @@ -315,7 +308,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringZeroTerminated) constructor << "driver={" << testDriverName << "};" << "address=" << testAddressStr << ';' - << "lazy=" << BoolToStr(testLazy) << ';' << "page_size=" << testPageSize << ';' << "replicated_only=" << BoolToStr(testReplicatedOnly) << ';' << "collocated=" << BoolToStr(testCollocated) << ';' @@ -341,7 +333,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringMixed) std::stringstream constructor; constructor << "Driver={" << testDriverName << "};" - << "Lazy=" << BoolToStr(testLazy) << ';' << "Address=" << testAddressStr << ';' << "Page_Size=" << testPageSize << ';' << "Distributed_Joins=" << BoolToStr(testDistributedJoins, false) << ';' @@ -369,7 +360,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringWhitepaces) << " ADDRESS =" << testAddressStr << "; " << " PAGE_SIZE= " << testPageSize << ';' << " DISTRIBUTED_JOINS=" << BoolToStr(testDistributedJoins, false) << ';' - << "LAZY=" << BoolToStr(testLazy, false) << ';' << "COLLOCATED =" << BoolToStr(testCollocated, false) << " ;" << " REPLICATED_ONLY= " << BoolToStr(testReplicatedOnly, false) << ';' << "ENFORCE_JOIN_ORDER= " << BoolToStr(testEnforceJoinOrder, false) << " ;" @@ -464,7 +454,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringInvalidBoolKeys) keys.insert("enforce_join_order"); keys.insert("replicated_only"); keys.insert("collocated"); - keys.insert("lazy"); keys.insert("skip_reducer_on_update"); for (Set::const_iterator it = keys.begin(); it != keys.end(); ++it) @@ -492,7 +481,6 @@ BOOST_AUTO_TEST_CASE(TestConnectStringValidBoolKeys) keys.insert("enforce_join_order"); keys.insert("replicated_only"); keys.insert("collocated"); - keys.insert("lazy"); keys.insert("skip_reducer_on_update"); for (Set::const_iterator it = keys.begin(); it != keys.end(); ++it) diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h index ed2fa9b76dbf3..b55eca6e1f26f 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h @@ -94,9 +94,6 @@ namespace ignite /** Default value for collocated attribute. */ static const bool collocated; - /** Default value for lazy attribute. */ - static const bool lazy; - /** Default value for skipReducerOnUpdate attribute. */ static const bool skipReducerOnUpdate; @@ -414,27 +411,6 @@ namespace ignite */ bool IsCollocatedSet() const; - /** - * Check lazy flag. - * - * @return True if lazy is enabled. - */ - bool IsLazy() const; - - /** - * Set lazy. - * - * @param val Value to set. - */ - void SetLazy(bool val); - - /** - * Check if the value set. - * - * @return @true if the value set. - */ - bool IsLazySet() const; - /** * Check update on server flag. * @@ -609,9 +585,6 @@ namespace ignite /** Collocated flag. */ SettableValue collocated; - /** Lazy flag. */ - SettableValue lazy; - /** Skip reducer on update flag. */ SettableValue skipReducerOnUpdate; diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_string_parser.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_string_parser.h index bd5352d5318b2..4b8e2e9443c66 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_string_parser.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/connection_string_parser.h @@ -74,9 +74,6 @@ namespace ignite /** Connection attribute keyword for collocated attribute. */ static const std::string collocated; - /** Connection attribute keyword for lazy attribute. */ - static const std::string lazy; - /** Connection attribute keyword for skipReducerOnUpdate attribute. */ static const std::string skipReducerOnUpdate; diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h index 7dd21f8cfa0cf..11e7fc73ed1b7 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h @@ -57,7 +57,6 @@ namespace ignite ENFORCE_JOIN_ORDER_CHECK_BOX, REPLICATED_ONLY_CHECK_BOX, COLLOCATED_CHECK_BOX, - LAZY_CHECK_BOX, SKIP_REDUCER_ON_UPDATE_CHECK_BOX, PROTOCOL_VERSION_LABEL, PROTOCOL_VERSION_COMBO_BOX, @@ -260,9 +259,6 @@ namespace ignite /** Collocated CheckBox. */ std::auto_ptr collocatedCheckBox; - /** Lazy CheckBox. */ - std::auto_ptr lazyCheckBox; - /** Update on server CheckBox. */ std::auto_ptr skipReducerOnUpdateCheckBox; diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp index b020b7b39391c..3e4cecd083910 100644 --- a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp +++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp @@ -353,11 +353,6 @@ namespace ignite rowPos += ROW_HEIGHT; - lazyCheckBox = CreateCheckBox(labelPosX, rowPos, checkBoxSize, ROW_HEIGHT, - "Lazy", ChildId::LAZY_CHECK_BOX, config.IsLazy()); - - lazyCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_1_5); - skipReducerOnUpdateCheckBox = CreateCheckBox(labelPosX + checkBoxSize + INTERVAL, rowPos, checkBoxSize, ROW_HEIGHT, "Skip reducer on update", ChildId::SKIP_REDUCER_ON_UPDATE_CHECK_BOX, config.IsSkipReducerOnUpdate()); @@ -434,13 +429,6 @@ namespace ignite break; } - case ChildId::LAZY_CHECK_BOX: - { - lazyCheckBox->SetChecked(!lazyCheckBox->IsChecked()); - - break; - } - case ChildId::SKIP_REDUCER_ON_UPDATE_CHECK_BOX: { skipReducerOnUpdateCheckBox->SetChecked(!skipReducerOnUpdateCheckBox->IsChecked()); @@ -454,7 +442,6 @@ namespace ignite protocolVersionComboBox->GetText(versionStr); ProtocolVersion version = ProtocolVersion::FromString(versionStr); - lazyCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_1_5); skipReducerOnUpdateCheckBox->SetEnabled(version >= ProtocolVersion::VERSION_2_3_0); engineModeComboBox->SetEnabled(version >= ProtocolVersion::VERSION_2_13_0); @@ -613,7 +600,6 @@ namespace ignite bool enforceJoinOrder = enforceJoinOrderCheckBox->IsChecked(); bool replicatedOnly = replicatedOnlyCheckBox->IsChecked(); bool collocated = collocatedCheckBox->IsChecked(); - bool lazy = lazyCheckBox->IsChecked(); bool skipReducerOnUpdate = skipReducerOnUpdateCheckBox->IsChecked(); LOG_MSG("Retrieving arguments:"); @@ -623,7 +609,6 @@ namespace ignite LOG_MSG("Enforce Join Order: " << (enforceJoinOrder ? "true" : "false")); LOG_MSG("Replicated only: " << (replicatedOnly ? "true" : "false")); LOG_MSG("Collocated: " << (collocated ? "true" : "false")); - LOG_MSG("Lazy: " << (lazy ? "true" : "false")); LOG_MSG("Skip reducer on update: " << (skipReducerOnUpdate ? "true" : "false")); cfg.SetPageSize(pageSize); @@ -632,7 +617,6 @@ namespace ignite cfg.SetEnforceJoinOrder(enforceJoinOrder); cfg.SetReplicatedOnly(replicatedOnly); cfg.SetCollocated(collocated); - cfg.SetLazy(lazy); cfg.SetSkipReducerOnUpdate(skipReducerOnUpdate); } } diff --git a/modules/platforms/cpp/odbc/src/config/configuration.cpp b/modules/platforms/cpp/odbc/src/config/configuration.cpp index 92b39904cc692..5ec117fc70c2f 100644 --- a/modules/platforms/cpp/odbc/src/config/configuration.cpp +++ b/modules/platforms/cpp/odbc/src/config/configuration.cpp @@ -43,7 +43,6 @@ namespace ignite const bool Configuration::DefaultValue::enforceJoinOrder = false; const bool Configuration::DefaultValue::replicatedOnly = false; const bool Configuration::DefaultValue::collocated = false; - const bool Configuration::DefaultValue::lazy = false; const bool Configuration::DefaultValue::skipReducerOnUpdate = false; const ProtocolVersion& Configuration::DefaultValue::protocolVersion = ProtocolVersion::GetCurrent(); @@ -69,7 +68,6 @@ namespace ignite enforceJoinOrder(DefaultValue::enforceJoinOrder), replicatedOnly(DefaultValue::replicatedOnly), collocated(DefaultValue::collocated), - lazy(DefaultValue::lazy), skipReducerOnUpdate(DefaultValue::skipReducerOnUpdate), protocolVersion(DefaultValue::protocolVersion), endPoints(std::vector()), @@ -322,21 +320,6 @@ namespace ignite return collocated.IsSet(); } - bool Configuration::IsLazy() const - { - return lazy.GetValue(); - } - - void Configuration::SetLazy(bool val) - { - this->lazy.SetValue(val); - } - - bool Configuration::IsLazySet() const - { - return lazy.IsSet(); - } - bool Configuration::IsSkipReducerOnUpdate() const { return skipReducerOnUpdate.GetValue(); @@ -438,7 +421,6 @@ namespace ignite AddToMap(res, ConnectionStringParser::Key::pageSize, pageSize); AddToMap(res, ConnectionStringParser::Key::replicatedOnly, replicatedOnly); AddToMap(res, ConnectionStringParser::Key::collocated, collocated); - AddToMap(res, ConnectionStringParser::Key::lazy, lazy); AddToMap(res, ConnectionStringParser::Key::skipReducerOnUpdate, skipReducerOnUpdate); AddToMap(res, ConnectionStringParser::Key::sslMode, sslMode); AddToMap(res, ConnectionStringParser::Key::sslKeyFile, sslKeyFile); @@ -513,4 +495,3 @@ namespace ignite } } } - diff --git a/modules/platforms/cpp/odbc/src/config/connection_string_parser.cpp b/modules/platforms/cpp/odbc/src/config/connection_string_parser.cpp index 25bad8eea0616..c6de773a4c6e5 100644 --- a/modules/platforms/cpp/odbc/src/config/connection_string_parser.cpp +++ b/modules/platforms/cpp/odbc/src/config/connection_string_parser.cpp @@ -42,7 +42,6 @@ namespace ignite const std::string ConnectionStringParser::Key::pageSize = "page_size"; const std::string ConnectionStringParser::Key::replicatedOnly = "replicated_only"; const std::string ConnectionStringParser::Key::collocated = "collocated"; - const std::string ConnectionStringParser::Key::lazy = "lazy"; const std::string ConnectionStringParser::Key::skipReducerOnUpdate = "skip_reducer_on_update"; const std::string ConnectionStringParser::Key::sslMode = "ssl_mode"; const std::string ConnectionStringParser::Key::sslKeyFile = "ssl_key_file"; @@ -351,23 +350,6 @@ namespace ignite cfg.SetCollocated(res == BoolParseResult::AI_TRUE); } - else if (lKey == Key::lazy) - { - BoolParseResult::Type res = StringToBool(value); - - if (res == BoolParseResult::AI_UNRECOGNIZED) - { - if (diag) - { - diag->AddStatusRecord(SqlState::S01S02_OPTION_VALUE_CHANGED, - MakeErrorMessage("Unrecognized bool value. Defaulting to 'false'.", key, value)); - } - - return; - } - - cfg.SetLazy(res == BoolParseResult::AI_TRUE); - } else if (lKey == Key::skipReducerOnUpdate) { BoolParseResult::Type res = StringToBool(value); @@ -490,4 +472,3 @@ namespace ignite } } } - diff --git a/modules/platforms/cpp/odbc/src/dsn_config.cpp b/modules/platforms/cpp/odbc/src/dsn_config.cpp index 1d8c0f69c1326..86c6f69771fd4 100644 --- a/modules/platforms/cpp/odbc/src/dsn_config.cpp +++ b/modules/platforms/cpp/odbc/src/dsn_config.cpp @@ -150,11 +150,6 @@ namespace ignite if (collocated.IsSet() && !config.IsCollocatedSet()) config.SetCollocated(collocated.GetValue()); - SettableValue lazy = ReadDsnBool(dsn, ConnectionStringParser::Key::lazy); - - if (lazy.IsSet() && !config.IsLazySet()) - config.SetLazy(lazy.GetValue()); - SettableValue skipReducerOnUpdate = ReadDsnBool(dsn, ConnectionStringParser::Key::skipReducerOnUpdate); if (skipReducerOnUpdate.IsSet() && !config.IsSkipReducerOnUpdateSet()) diff --git a/modules/platforms/cpp/odbc/src/message.cpp b/modules/platforms/cpp/odbc/src/message.cpp index bdc262d14d95b..efd97b06e6b35 100644 --- a/modules/platforms/cpp/odbc/src/message.cpp +++ b/modules/platforms/cpp/odbc/src/message.cpp @@ -75,7 +75,7 @@ namespace ignite writer.WriteBool(config.IsCollocated()); if (version >= ProtocolVersion::VERSION_2_1_5) - writer.WriteBool(config.IsLazy()); + writer.WriteBool(true); if (version >= ProtocolVersion::VERSION_2_3_0) writer.WriteBool(config.IsSkipReducerOnUpdate()); @@ -573,4 +573,3 @@ namespace ignite } } } - diff --git a/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp b/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp index d2eca8205bb9c..14c6116303912 100644 --- a/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp +++ b/modules/platforms/cpp/thin-client-test/src/sql_fields_query_test.cpp @@ -109,7 +109,6 @@ BOOST_AUTO_TEST_CASE(SqlFieldsQueryDefaults) BOOST_CHECK(!qry.IsCollocated()); BOOST_CHECK(!qry.IsDistributedJoins()); BOOST_CHECK(!qry.IsEnforceJoinOrder()); - BOOST_CHECK(qry.IsLazy()); } BOOST_AUTO_TEST_CASE(SqlFieldsQuerySetGet) @@ -127,7 +126,6 @@ BOOST_AUTO_TEST_CASE(SqlFieldsQuerySetGet) qry.SetCollocated(true); qry.SetDistributedJoins(true); qry.SetEnforceJoinOrder(true); - qry.SetLazy(true); qry.SetUpdateBatchSize(42); @@ -149,7 +147,6 @@ BOOST_AUTO_TEST_CASE(SqlFieldsQuerySetGet) BOOST_CHECK(qry.IsCollocated()); BOOST_CHECK(qry.IsDistributedJoins()); BOOST_CHECK(qry.IsEnforceJoinOrder()); - BOOST_CHECK(qry.IsLazy()); BOOST_CHECK_EQUAL(qry.GetUpdateBatchSize(), 42); diff --git a/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h b/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h index 289e7b93ea1d6..ee3e3e6d1bac3 100644 --- a/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h +++ b/modules/platforms/cpp/thin-client/include/ignite/thin/cache/query/query_sql_fields.h @@ -68,7 +68,6 @@ namespace ignite loc(false), distributedJoins(false), enforceJoinOrder(false), - lazy(true), collocated(false), parts(), updateBatchSize(1), @@ -91,7 +90,6 @@ namespace ignite loc(other.loc), distributedJoins(other.distributedJoins), enforceJoinOrder(other.enforceJoinOrder), - lazy(other.lazy), collocated(other.collocated), parts(other.parts), updateBatchSize(other.updateBatchSize), @@ -149,7 +147,6 @@ namespace ignite swap(loc, other.loc); swap(distributedJoins, other.distributedJoins); swap(enforceJoinOrder, other.enforceJoinOrder); - swap(lazy, other.lazy); swap(collocated, other.collocated); swap(parts, other.parts); swap(args, other.args); @@ -334,40 +331,6 @@ namespace ignite enforceJoinOrder = enforce; } - /** - * Gets lazy query execution flag. - * - * See SetLazy(bool) for more information. - * - * @return Lazy flag. - * @deprecated Deprecated for removal. Use the page size instead. - */ - bool IsLazy() const - { - return lazy; - } - - /** - * Sets lazy query execution flag. - * - * By default Ignite attempts to fetch the whole query result set to memory and send it to the - * client. For small and medium result sets this provides optimal performance and minimize duration - * of internal database locks, thus increasing concurrency. - * - * If result set is too big to fit in available memory this could lead to excessive GC pauses and - * even OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus - * minimizing memory consumption at the cost of moderate performance hit. - * - * Defaults to @c false, meaning that the whole result set is fetched to memory eagerly. - * - * @param lazy Lazy query execution flag. - * @deprecated Deprecated for removal. Use the page size instead. - */ - void SetLazy(bool lazy) - { - this->lazy = lazy; - } - /** * Checks if this query is collocated. * @@ -503,9 +466,6 @@ namespace ignite /** Enforce join order flag. */ bool enforceJoinOrder; - /** Lazy flag. */ - bool lazy; - /** Collocated flag. */ bool collocated; diff --git a/modules/platforms/cpp/thin-client/src/impl/message.cpp b/modules/platforms/cpp/thin-client/src/impl/message.cpp index f9289a6f986f0..2b7c65b4db4e5 100644 --- a/modules/platforms/cpp/thin-client/src/impl/message.cpp +++ b/modules/platforms/cpp/thin-client/src/impl/message.cpp @@ -396,7 +396,7 @@ namespace ignite writer.WriteBool(false); // Replicated only writer.WriteBool(qry.enforceJoinOrder); writer.WriteBool(qry.collocated); - writer.WriteBool(qry.lazy); + writer.WriteBool(true); // Lazy flag. writer.WriteInt64(qry.timeout); writer.WriteBool(true); // Include field names @@ -491,4 +491,3 @@ namespace ignite } } } - diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs index 4cacdc760876a..d2a473c9b4e04 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs @@ -378,7 +378,7 @@ public void TestSqlQuery([Values(true, false)] bool loc, [Values(true, false)] b /// [Test] public void TestSqlFieldsQuery([Values(true, false)] bool loc, [Values(true, false)] bool distrJoin, - [Values(true, false)] bool enforceJoinOrder, [Values(true, false)] bool lazy) + [Values(true, false)] bool enforceJoinOrder) { int cnt = MaxItemCnt; @@ -397,10 +397,7 @@ public void TestSqlFieldsQuery([Values(true, false)] bool loc, [Values(true, fal ReplicatedOnly = false, #pragma warning restore 618 Local = loc, - Timeout = TimeSpan.FromSeconds(2), -#pragma warning disable 618 - Lazy = lazy -#pragma warning restore 618 + Timeout = TimeSpan.FromSeconds(2) }; using (var cursor = cache.Query(qry)) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs index 6201e73ce1e57..ed1f8e1cb7139 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs @@ -56,9 +56,6 @@ public void TestIntrospection() ReplicatedOnly = true, #pragma warning restore 618 Colocated = true, -#pragma warning disable 618 - Lazy = true, -#pragma warning restore 618 UpdateBatchSize = 12, EnableDistributedJoins = true }).Where(x => x.Key > 10).ToCacheQueryable(); @@ -86,9 +83,6 @@ public void TestIntrospection() #pragma warning restore 618 Assert.IsTrue(fq.Colocated); Assert.AreEqual(TimeSpan.FromSeconds(2.5), fq.Timeout); -#pragma warning disable 618 - Assert.IsTrue(fq.Lazy); -#pragma warning restore 618 Assert.IsTrue(fq.EnableDistributedJoins); Assert.AreEqual(12, fq.UpdateBatchSize); Assert.IsNull(fq.Partitions); @@ -100,13 +94,13 @@ public void TestIntrospection() "(_T0.\"_KEY\" > ?), Arguments=[10], " + "Local=True, PageSize=999, EnableDistributedJoins=True, EnforceJoinOrder=True, " + "Timeout=00:00:02.5000000, Partitions=[], UpdateBatchSize=12, " + - "Colocated=True, Schema=, Lazy=True]]" + "Colocated=True, Schema=]]" : "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " + "[Sql=select _T0._KEY, _T0._VAL from PERSON_ORG_SCHEMA.Person as _T0 where " + "(_T0._KEY > ?), Arguments=[10], " + "Local=True, PageSize=999, EnableDistributedJoins=True, EnforceJoinOrder=True, " + "Timeout=00:00:02.5000000, Partitions=[], UpdateBatchSize=12, " + - "Colocated=True, Schema=, Lazy=True]]", str); + "Colocated=True, Schema=]]", str); // Check fields query var fieldsQuery = cache @@ -129,9 +123,6 @@ public void TestIntrospection() Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize); Assert.IsFalse(fq.EnableDistributedJoins); Assert.IsFalse(fq.EnforceJoinOrder); -#pragma warning disable 618 - Assert.IsTrue(fq.Lazy); -#pragma warning restore 618 Assert.AreEqual(new[] {1, 2}, fq.Partitions); str = fieldsQuery.ToString(); @@ -139,11 +130,11 @@ public void TestIntrospection() ? "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " + "[Sql=select _T0.\"Name\" from PERSON_ORG_SCHEMA.\"Person\" as _T0, Arguments=[], Local=False, " + "PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False, " + - "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]" + "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=]]" : "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " + "[Sql=select _T0.NAME from PERSON_ORG_SCHEMA.Person as _T0, Arguments=[], Local=False, " + "PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False, " + - "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str); + "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=]]", str); // Check distributed joins flag propagation var distrQuery = cache.AsCacheQueryable(new QueryOptions { EnableDistributedJoins = true }) @@ -160,13 +151,13 @@ public void TestIntrospection() "(((_T0.\"_KEY\" > ?) and (_T0.\"age1\" > ?)) " + "and (_T0.\"Name\" like \'%\' || ? || \'%\') ), Arguments=[10, 20, x], Local=False, " + "PageSize=1024, EnableDistributedJoins=True, EnforceJoinOrder=False, " + - "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]" + "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=]]" : "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " + "[Sql=select _T0._KEY, _T0._VAL from PERSON_ORG_SCHEMA.Person as _T0 where " + "(((_T0._KEY > ?) and (_T0.AGE1 > ?)) " + "and (_T0.NAME like \'%\' || ? || \'%\') ), Arguments=[10, 20, x], Local=False, " + "PageSize=1024, EnableDistributedJoins=True, EnforceJoinOrder=False, " + - "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str); + "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=]]", str); } } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs index bdb11c9927432..4cf603bc7ffda 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs @@ -110,9 +110,6 @@ public void TestFieldsQuery() // Filter. qry = new SqlFieldsQuery("select Name from Person where Id = ?", 1) { -#pragma warning disable 618 - Lazy = true, -#pragma warning restore 618 PageSize = 5, }; Assert.AreEqual("Person 1", cache.Query(qry).Single().Single()); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs index d3ef89a75c499..6178335d07934 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs @@ -59,9 +59,6 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args) PageSize = DefaultPageSize; UpdateBatchSize = DefaultUpdateBatchSize; -#pragma warning disable 618 - Lazy = true; -#pragma warning restore 618 } ///

    @@ -146,20 +143,6 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args) /// public string Schema { get; set; } - /// - /// Gets or sets a value indicating whether this is lazy. - /// - /// By default Ignite attempts to fetch the whole query result set to memory and send it to the client. - /// For small and medium result sets this provides optimal performance and minimize duration of internal - /// database locks, thus increasing concurrency. - /// - /// If result set is too big to fit in available memory this could lead to excessive GC pauses and even - /// OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory - /// consumption at the cost of moderate performance hit. - /// - [Obsolete("Deprecated for removal. Use the page size instead.")] - public bool Lazy { get; set; } - /// /// Gets or sets partitions for the query. /// @@ -190,13 +173,12 @@ public override string ToString() var parts = Partitions == null ? "" : string.Join(", ", Partitions.Select(x => x.ToString())); -#pragma warning disable 618 + return string.Format("SqlFieldsQuery [Sql={0}, Arguments=[{1}], Local={2}, PageSize={3}, " + "EnableDistributedJoins={4}, EnforceJoinOrder={5}, Timeout={6}, Partitions=[{7}], " + - "UpdateBatchSize={8}, Colocated={9}, Schema={10}, Lazy={11}]", Sql, args, Local, + "UpdateBatchSize={8}, Colocated={9}, Schema={10}]", Sql, args, Local, PageSize, EnableDistributedJoins, EnforceJoinOrder, Timeout, parts, - UpdateBatchSize, Colocated, Schema, Lazy); -#pragma warning restore 618 + UpdateBatchSize, Colocated, Schema); } /** */ @@ -218,9 +200,7 @@ internal void Write(BinaryWriter writer) writer.WriteBoolean(EnableDistributedJoins); writer.WriteBoolean(EnforceJoinOrder); -#pragma warning disable 618 - writer.WriteBoolean(Lazy); // Lazy flag. -#pragma warning restore 618 + writer.WriteBoolean(true); // Lazy flag. writer.WriteInt((int) Timeout.TotalMilliseconds); #pragma warning disable 618 writer.WriteBoolean(ReplicatedOnly); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs index f9426ab2f6625..5aafdbee4ec70 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs @@ -942,9 +942,7 @@ private static void WriteSqlFieldsQuery(IBinaryRawWriter writer, SqlFieldsQuery #pragma warning restore 618 writer.WriteBoolean(qry.EnforceJoinOrder); writer.WriteBoolean(qry.Colocated); -#pragma warning disable 618 - writer.WriteBoolean(qry.Lazy); -#pragma warning restore 618 + writer.WriteBoolean(true); // Lazy flag. writer.WriteTimeSpanAsLong(qry.Timeout); writer.WriteBoolean(includeColumns); diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs index 7bf7908ade773..9c823878fa54c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs @@ -210,9 +210,6 @@ internal SqlFieldsQuery GetFieldsQuery(string text, object[] args) Colocated = _options.Colocated, Local = _options.Local, Arguments = args, -#pragma warning disable 618 - Lazy = _options.Lazy, -#pragma warning restore 618 UpdateBatchSize = _options.UpdateBatchSize, Partitions = _options.Partitions }; diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs index 65ee860f93c6f..5d7871160e83f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs @@ -41,9 +41,6 @@ public QueryOptions() { PageSize = DefaultPageSize; UpdateBatchSize = DefaultUpdateBatchSize; -#pragma warning disable 618 - Lazy = true; -#pragma warning restore 618 } /// @@ -120,20 +117,6 @@ public QueryOptions() /// public bool Colocated { get; set; } - /// - /// Gets or sets a value indicating whether this query is lazy. - /// - /// By default Ignite attempts to fetch the whole query result set to memory and send it to the client. - /// For small and medium result sets this provides optimal performance and minimize duration of internal - /// database locks, thus increasing concurrency. - /// - /// If result set is too big to fit in available memory this could lead to excessive GC pauses and even - /// OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory - /// consumption at the cost of moderate performance hit. - /// - [Obsolete("Deprecated for removal. Use the page size instead.")] - public bool Lazy { get; set; } - /// /// Gets or sets partitions for the query. ///