Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,19 @@

/**
* @return Lazy query execution flag.
* @deprecated Use query page size property instead.
*/
@Deprecated(forRemoval = true)
public boolean isLazy() {

Check warning on line 319 in modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZ0wuZyimIEHLU8AsITC&open=AZ0wuZyimIEHLU8AsITC&pullRequest=12949
return props.isLazy();
}

/**
* @param lazy Lazy query execution flag.
* @deprecated Use query page size property instead.
*/
@Deprecated(forRemoval = true)
public void setLazy(boolean lazy) {

Check warning on line 328 in modules/core/src/main/java/org/apache/ignite/IgniteJdbcThinDataSource.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZ0wuZyimIEHLU8AsITD&open=AZ0wuZyimIEHLU8AsITD&pullRequest=12949
props.setLazy(lazy);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace ignite
loc(false),
distributedJoins(false),
enforceJoinOrder(false),
lazy(false),
lazy(true),
args()
{
// No-op.
Expand All @@ -73,7 +73,7 @@ namespace ignite
loc(loc),
distributedJoins(false),
enforceJoinOrder(false),
lazy(false),
lazy(true),
args()
{
// No-op.
Expand Down Expand Up @@ -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
{
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace ignite
loc(false),
distributedJoins(false),
enforceJoinOrder(false),
lazy(false),
lazy(true),
collocated(false),
parts(),
updateBatchSize(1),
Expand Down Expand Up @@ -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
{
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -125,19 +129,21 @@ 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();
Assert.AreEqual(GetSqlEscapeAll()
? "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 })
Expand All @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -347,7 +348,7 @@ public void TestTimeout()
});

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
var ex = Assert.Throws<CacheException>(() =>
var ex = Assert.Throws<IgniteException>(() =>
{
for (var i = 0; i < 100; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/// <summary>
Expand Down Expand Up @@ -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.
/// </summary>
[Obsolete("Deprecated for removal. Use the page size instead.")]
public bool Lazy { get; set; }

/// <summary>
Expand Down Expand Up @@ -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
}

/** <inheritdoc /> */
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
4 changes: 4 additions & 0 deletions modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public QueryOptions()
{
PageSize = DefaultPageSize;
UpdateBatchSize = DefaultUpdateBatchSize;
#pragma warning disable 618
Lazy = true;
#pragma warning restore 618
}

/// <summary>
Expand Down Expand Up @@ -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.
/// </summary>
[Obsolete("Deprecated for removal. Use the page size instead.")]
public bool Lazy { get; set; }

/// <summary>
Expand Down
Loading