Skip to content

Commit d09e738

Browse files
committed
WIP dot net
1 parent 7f45d6a commit d09e738

7 files changed

Lines changed: 13 additions & 70 deletions

File tree

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public void TestSqlQuery([Values(true, false)] bool loc, [Values(true, false)] b
378378
/// </summary>
379379
[Test]
380380
public void TestSqlFieldsQuery([Values(true, false)] bool loc, [Values(true, false)] bool distrJoin,
381-
[Values(true, false)] bool enforceJoinOrder, [Values(true, false)] bool lazy)
381+
[Values(true, false)] bool enforceJoinOrder)
382382
{
383383
int cnt = MaxItemCnt;
384384

@@ -397,10 +397,7 @@ public void TestSqlFieldsQuery([Values(true, false)] bool loc, [Values(true, fal
397397
ReplicatedOnly = false,
398398
#pragma warning restore 618
399399
Local = loc,
400-
Timeout = TimeSpan.FromSeconds(2),
401-
#pragma warning disable 618
402-
Lazy = lazy
403-
#pragma warning restore 618
400+
Timeout = TimeSpan.FromSeconds(2)
404401
};
405402

406403
using (var cursor = cache.Query(qry))

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Introspection.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ public void TestIntrospection()
5656
ReplicatedOnly = true,
5757
#pragma warning restore 618
5858
Colocated = true,
59-
#pragma warning disable 618
60-
Lazy = true,
61-
#pragma warning restore 618
6259
UpdateBatchSize = 12,
6360
EnableDistributedJoins = true
6461
}).Where(x => x.Key > 10).ToCacheQueryable();
@@ -86,9 +83,6 @@ public void TestIntrospection()
8683
#pragma warning restore 618
8784
Assert.IsTrue(fq.Colocated);
8885
Assert.AreEqual(TimeSpan.FromSeconds(2.5), fq.Timeout);
89-
#pragma warning disable 618
90-
Assert.IsTrue(fq.Lazy);
91-
#pragma warning restore 618
9286
Assert.IsTrue(fq.EnableDistributedJoins);
9387
Assert.AreEqual(12, fq.UpdateBatchSize);
9488
Assert.IsNull(fq.Partitions);
@@ -100,13 +94,13 @@ public void TestIntrospection()
10094
"(_T0.\"_KEY\" > ?), Arguments=[10], " +
10195
"Local=True, PageSize=999, EnableDistributedJoins=True, EnforceJoinOrder=True, " +
10296
"Timeout=00:00:02.5000000, Partitions=[], UpdateBatchSize=12, " +
103-
"Colocated=True, Schema=, Lazy=True]]"
97+
"Colocated=True, Schema=]]"
10498
: "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
10599
"[Sql=select _T0._KEY, _T0._VAL from PERSON_ORG_SCHEMA.Person as _T0 where " +
106100
"(_T0._KEY > ?), Arguments=[10], " +
107101
"Local=True, PageSize=999, EnableDistributedJoins=True, EnforceJoinOrder=True, " +
108102
"Timeout=00:00:02.5000000, Partitions=[], UpdateBatchSize=12, " +
109-
"Colocated=True, Schema=, Lazy=True]]", str);
103+
"Colocated=True, Schema=]]", str);
110104

111105
// Check fields query
112106
var fieldsQuery = cache
@@ -129,21 +123,18 @@ public void TestIntrospection()
129123
Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize);
130124
Assert.IsFalse(fq.EnableDistributedJoins);
131125
Assert.IsFalse(fq.EnforceJoinOrder);
132-
#pragma warning disable 618
133-
Assert.IsTrue(fq.Lazy);
134-
#pragma warning restore 618
135126
Assert.AreEqual(new[] {1, 2}, fq.Partitions);
136127

137128
str = fieldsQuery.ToString();
138129
Assert.AreEqual(GetSqlEscapeAll()
139130
? "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
140131
"[Sql=select _T0.\"Name\" from PERSON_ORG_SCHEMA.\"Person\" as _T0, Arguments=[], Local=False, " +
141132
"PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False, " +
142-
"Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]"
133+
"Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=]]"
143134
: "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
144135
"[Sql=select _T0.NAME from PERSON_ORG_SCHEMA.Person as _T0, Arguments=[], Local=False, " +
145136
"PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False, " +
146-
"Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str);
137+
"Timeout=00:00:00, Partitions=[1, 2], UpdateBatchSize=1, Colocated=False, Schema=]]", str);
147138

148139
// Check distributed joins flag propagation
149140
var distrQuery = cache.AsCacheQueryable(new QueryOptions { EnableDistributedJoins = true })
@@ -160,13 +151,13 @@ public void TestIntrospection()
160151
"(((_T0.\"_KEY\" > ?) and (_T0.\"age1\" > ?)) " +
161152
"and (_T0.\"Name\" like \'%\' || ? || \'%\') ), Arguments=[10, 20, x], Local=False, " +
162153
"PageSize=1024, EnableDistributedJoins=True, EnforceJoinOrder=False, " +
163-
"Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]"
154+
"Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=]]"
164155
: "CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
165156
"[Sql=select _T0._KEY, _T0._VAL from PERSON_ORG_SCHEMA.Person as _T0 where " +
166157
"(((_T0._KEY > ?) and (_T0.AGE1 > ?)) " +
167158
"and (_T0.NAME like \'%\' || ? || \'%\') ), Arguments=[10, 20, x], Local=False, " +
168159
"PageSize=1024, EnableDistributedJoins=True, EnforceJoinOrder=False, " +
169-
"Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=, Lazy=True]]", str);
160+
"Timeout=00:00:00, Partitions=[], UpdateBatchSize=1, Colocated=False, Schema=]]", str);
170161
}
171162
}
172163
}

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ public void TestFieldsQuery()
110110
// Filter.
111111
qry = new SqlFieldsQuery("select Name from Person where Id = ?", 1)
112112
{
113-
#pragma warning disable 618
114-
Lazy = true,
115-
#pragma warning restore 618
116113
PageSize = 5,
117114
};
118115
Assert.AreEqual("Person 1", cache.Query(qry).Single().Single());

modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args)
5959

6060
PageSize = DefaultPageSize;
6161
UpdateBatchSize = DefaultUpdateBatchSize;
62-
#pragma warning disable 618
63-
Lazy = true;
64-
#pragma warning restore 618
6562
}
6663

6764
/// <summary>
@@ -146,20 +143,6 @@ public SqlFieldsQuery(string sql, bool loc, params object[] args)
146143
/// </summary>
147144
public string Schema { get; set; }
148145

149-
/// <summary>
150-
/// Gets or sets a value indicating whether this <see cref="SqlFieldsQuery"/> is lazy.
151-
/// <para />
152-
/// By default Ignite attempts to fetch the whole query result set to memory and send it to the client.
153-
/// For small and medium result sets this provides optimal performance and minimize duration of internal
154-
/// database locks, thus increasing concurrency.
155-
/// <para />
156-
/// If result set is too big to fit in available memory this could lead to excessive GC pauses and even
157-
/// OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory
158-
/// consumption at the cost of moderate performance hit.
159-
/// </summary>
160-
[Obsolete("Deprecated for removal. Use the page size instead.")]
161-
public bool Lazy { get; set; }
162-
163146
/// <summary>
164147
/// Gets or sets partitions for the query.
165148
/// <para />
@@ -190,13 +173,12 @@ public override string ToString()
190173
var parts = Partitions == null
191174
? ""
192175
: string.Join(", ", Partitions.Select(x => x.ToString()));
193-
#pragma warning disable 618
176+
194177
return string.Format("SqlFieldsQuery [Sql={0}, Arguments=[{1}], Local={2}, PageSize={3}, " +
195178
"EnableDistributedJoins={4}, EnforceJoinOrder={5}, Timeout={6}, Partitions=[{7}], " +
196-
"UpdateBatchSize={8}, Colocated={9}, Schema={10}, Lazy={11}]", Sql, args, Local,
179+
"UpdateBatchSize={8}, Colocated={9}, Schema={10}]", Sql, args, Local,
197180
PageSize, EnableDistributedJoins, EnforceJoinOrder, Timeout, parts,
198-
UpdateBatchSize, Colocated, Schema, Lazy);
199-
#pragma warning restore 618
181+
UpdateBatchSize, Colocated, Schema);
200182
}
201183

202184
/** <inheritdoc /> */
@@ -218,9 +200,7 @@ internal void Write(BinaryWriter writer)
218200

219201
writer.WriteBoolean(EnableDistributedJoins);
220202
writer.WriteBoolean(EnforceJoinOrder);
221-
#pragma warning disable 618
222-
writer.WriteBoolean(Lazy); // Lazy flag.
223-
#pragma warning restore 618
203+
writer.WriteBoolean(true); // Lazy flag.
224204
writer.WriteInt((int) Timeout.TotalMilliseconds);
225205
#pragma warning disable 618
226206
writer.WriteBoolean(ReplicatedOnly);

modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,9 +942,7 @@ private static void WriteSqlFieldsQuery(IBinaryRawWriter writer, SqlFieldsQuery
942942
#pragma warning restore 618
943943
writer.WriteBoolean(qry.EnforceJoinOrder);
944944
writer.WriteBoolean(qry.Colocated);
945-
#pragma warning disable 618
946-
writer.WriteBoolean(qry.Lazy);
947-
#pragma warning restore 618
945+
writer.WriteBoolean(true); // Lazy flag.
948946
writer.WriteTimeSpanAsLong(qry.Timeout);
949947
writer.WriteBoolean(includeColumns);
950948

modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ internal SqlFieldsQuery GetFieldsQuery(string text, object[] args)
210210
Colocated = _options.Colocated,
211211
Local = _options.Local,
212212
Arguments = args,
213-
#pragma warning disable 618
214-
Lazy = _options.Lazy,
215-
#pragma warning restore 618
216213
UpdateBatchSize = _options.UpdateBatchSize,
217214
Partitions = _options.Partitions
218215
};

modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public QueryOptions()
4141
{
4242
PageSize = DefaultPageSize;
4343
UpdateBatchSize = DefaultUpdateBatchSize;
44-
#pragma warning disable 618
45-
Lazy = true;
46-
#pragma warning restore 618
4744
}
4845

4946
/// <summary>
@@ -120,20 +117,6 @@ public QueryOptions()
120117
/// </summary>
121118
public bool Colocated { get; set; }
122119

123-
/// <summary>
124-
/// Gets or sets a value indicating whether this query is lazy.
125-
/// <para />
126-
/// By default Ignite attempts to fetch the whole query result set to memory and send it to the client.
127-
/// For small and medium result sets this provides optimal performance and minimize duration of internal
128-
/// database locks, thus increasing concurrency.
129-
/// <para />
130-
/// If result set is too big to fit in available memory this could lead to excessive GC pauses and even
131-
/// OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory
132-
/// consumption at the cost of moderate performance hit.
133-
/// </summary>
134-
[Obsolete("Deprecated for removal. Use the page size instead.")]
135-
public bool Lazy { get; set; }
136-
137120
/// <summary>
138121
/// Gets or sets partitions for the query.
139122
/// <para />

0 commit comments

Comments
 (0)