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 35302031940a5..bc5dc85977c02 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java @@ -313,14 +313,18 @@ public void setTcpNoDelay(boolean 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); } 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 d921fb8ca041d..bab9c5ad6bf5d 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 @@ -339,7 +339,7 @@ public boolean isReplicatedOnly() { * @return {@code this} For chaining. * @deprecated Use {@link #setPageSize(int)} instead. */ - @Deprecated + @Deprecated(forRemoval = true) public SqlFieldsQuery setLazy(boolean lazy) { this.lazy = lazy; @@ -354,7 +354,7 @@ public SqlFieldsQuery setLazy(boolean lazy) { * @return Lazy flag. * @deprecated Use {@link #getPageSize()} instead. */ - @Deprecated + @Deprecated(forRemoval = true) public boolean isLazy() { return lazy; } 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 0f90efb819490..4a186abd3eced 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,7 @@ namespace ignite loc(false), distributedJoins(false), enforceJoinOrder(false), - lazy(false), + lazy(true), args() { // No-op. @@ -73,7 +73,7 @@ namespace ignite loc(loc), distributedJoins(false), enforceJoinOrder(false), - lazy(false), + lazy(true), args() { // No-op. @@ -220,6 +220,7 @@ namespace ignite * See SetLazy(bool) for more information. * * @return Lazy flag. + * @deprecated Deprecated for removal. Use the page size instead. */ bool IsLazy() const { @@ -240,6 +241,7 @@ namespace ignite * 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) { 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 4220db89700b9..d2eca8205bb9c 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,7 @@ BOOST_AUTO_TEST_CASE(SqlFieldsQueryDefaults) BOOST_CHECK(!qry.IsCollocated()); BOOST_CHECK(!qry.IsDistributedJoins()); BOOST_CHECK(!qry.IsEnforceJoinOrder()); - BOOST_CHECK(!qry.IsLazy()); + BOOST_CHECK(qry.IsLazy()); } BOOST_AUTO_TEST_CASE(SqlFieldsQuerySetGet) 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 fde76a87e1225..289e7b93ea1d6 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,7 @@ namespace ignite loc(false), distributedJoins(false), enforceJoinOrder(false), - lazy(false), + lazy(true), collocated(false), parts(), updateBatchSize(1), @@ -340,6 +340,7 @@ namespace ignite * See SetLazy(bool) for more information. * * @return Lazy flag. + * @deprecated Deprecated for removal. Use the page size instead. */ bool IsLazy() const { @@ -360,6 +361,7 @@ namespace ignite * 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) { 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 22ffd5443c613..4cacdc760876a 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 @@ -398,7 +398,9 @@ public void TestSqlFieldsQuery([Values(true, false)] bool loc, [Values(true, fal #pragma warning restore 618 Local = loc, Timeout = TimeSpan.FromSeconds(2), +#pragma warning disable 618 Lazy = lazy +#pragma warning restore 618 }; 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 a55eeb8bfb242..6201e73ce1e57 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,7 +56,9 @@ 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(); @@ -84,7 +86,9 @@ 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); @@ -125,7 +129,9 @@ public void TestIntrospection() Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize); Assert.IsFalse(fq.EnableDistributedJoins); Assert.IsFalse(fq.EnforceJoinOrder); - Assert.IsFalse(fq.Lazy); +#pragma warning disable 618 + Assert.IsTrue(fq.Lazy); +#pragma warning restore 618 Assert.AreEqual(new[] {1, 2}, fq.Partitions); str = fieldsQuery.ToString(); @@ -133,11 +139,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=False]]" + "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]" : "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=False]]", str); + "Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str); // Check distributed joins flag propagation var distrQuery = cache.AsCacheQueryable(new QueryOptions { EnableDistributedJoins = true }) @@ -154,13 +160,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=False]]" + "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]" : "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=False]]", str); + "Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str); } } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs index df5e893f6db42..dcad4bf72cb9b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Misc.cs @@ -31,6 +31,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq using System.Linq.Expressions; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cache.Configuration; + using Apache.Ignite.Core.Common; using Apache.Ignite.Linq; using NUnit.Framework; using NUnit.Framework.Constraints; @@ -347,7 +348,7 @@ public void TestTimeout() }); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed - var ex = Assert.Throws(() => + var ex = Assert.Throws(() => { for (var i = 0; i < 100; i++) { 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 7bbf522fed75e..bdb11c9927432 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,7 +110,9 @@ 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 40c1622e22c66..d3ef89a75c499 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs @@ -59,6 +59,9 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args) PageSize = DefaultPageSize; UpdateBatchSize = DefaultUpdateBatchSize; +#pragma warning disable 618 + Lazy = true; +#pragma warning restore 618 } /// @@ -154,6 +157,7 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args) /// 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; } /// @@ -186,12 +190,13 @@ 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, PageSize, EnableDistributedJoins, EnforceJoinOrder, Timeout, parts, UpdateBatchSize, Colocated, Schema, Lazy); +#pragma warning restore 618 } /** */ @@ -213,7 +218,9 @@ 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.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 236fa33ae5350..f9426ab2f6625 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,7 +942,9 @@ 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.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 780dd4e6dd4b3..7bf7908ade773 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs @@ -210,7 +210,9 @@ 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 3249835df53b7..65ee860f93c6f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs @@ -41,6 +41,9 @@ public QueryOptions() { PageSize = DefaultPageSize; UpdateBatchSize = DefaultUpdateBatchSize; +#pragma warning disable 618 + Lazy = true; +#pragma warning restore 618 } /// @@ -128,6 +131,7 @@ public QueryOptions() /// 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; } ///