You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2019/03/30 19:58:41 UTC
[ignite] branch ignite-11525 created (now d3e7b15)
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a change to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git.
at d3e7b15 Suppress compiler warnings - done
This branch includes the following new commits:
new 354e8fe Mark APIs as Obsolete
new 3187800 Suppress compiler warnings
new 01a59bc Suppress compiler warnings
new d3e7b15 Suppress compiler warnings - done
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[ignite] 02/04: Suppress compiler warnings
Posted by pt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 318780013f06352ad2ae2e2bee357b8e69442405
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:54:38 2019 +0300
Suppress compiler warnings
---
.../Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs | 2 ++
.../Cache/Query/CacheQueriesCodeConfigurationTest.cs | 4 ++++
.../Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs | 8 +++++++-
.../dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs | 2 ++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
index 005488a..4d523ba 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
@@ -99,7 +99,9 @@ namespace Apache.Ignite.Core.Tests.Binary.Serializable
};
// Test SQL.
+#pragma warning disable 618
var res = cache.Query(new SqlQuery(typeof(SimpleSerializable), "where Int = 2")).GetAll().Single();
+#pragma warning restore 618
Assert.AreEqual(2, res.Key);
Assert.AreEqual(2, res.Value.Int);
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
index 1d03c68..1e760e6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
@@ -85,7 +85,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
cache[1] = new QueryPerson("Arnold", 10);
cache[2] = new QueryPerson("John", 20);
+#pragma warning disable 618
using (var cursor = cache.Query(new SqlQuery(typeof (QueryPerson), "age > ? and birthday < ?",
+#pragma warning restore 618
10, DateTime.UtcNow)))
{
Assert.AreEqual(2, cursor.GetAll().Single().Key);
@@ -176,6 +178,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
cache[2] = new AttributeQueryPerson("John", 20);
+#pragma warning disable 618
using (var cursor = cache.Query(new SqlQuery(typeof(AttributeQueryPerson),
"age > ? and age < ? and birthday > ? and birthday < ?", 10, 30,
DateTime.UtcNow.AddYears(-21), DateTime.UtcNow.AddYears(-19))))
@@ -197,6 +200,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
{
Assert.AreEqual(1, cursor.GetAll().Single().Key);
}
+#pragma warning restore 618
using (var cursor = cache.Query(new TextQuery(typeof(AttributeQueryPerson), "Ar*")))
{
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 bee6ffd..110fa1e 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
@@ -139,6 +139,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
[Test]
public void TestValidationSql()
{
+#pragma warning disable 618
// 1. No sql.
Assert.Throws<ArgumentException>(() =>
{ Cache().Query(new SqlQuery(typeof(QueryPerson), null)); });
@@ -146,6 +147,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 2. No type.
Assert.Throws<ArgumentException>(() =>
{ Cache().Query(new SqlQuery((string)null, "age >= 50")); });
+#pragma warning restore 618
}
/// <summary>
@@ -184,7 +186,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Cache().Put(1, new QueryPerson("Petrov", 40));
Cache().Put(1, new QueryPerson("Sidorov", 50));
+#pragma warning disable 618
SqlQuery qry = new SqlQuery(typeof(QueryPerson), "age >= 20");
+#pragma warning restore 618
// 1. Test GetAll().
using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor = Cache().Query(qry))
@@ -212,6 +216,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
[SuppressMessage("ReSharper", "UnusedVariable")]
public void TestEnumerator()
{
+#pragma warning disable 618
Cache().Put(1, new QueryPerson("Ivanov", 30));
Cache().Put(2, new QueryPerson("Petrov", 40));
Cache().Put(3, new QueryPerson("Sidorov", 50));
@@ -219,7 +224,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 1. Empty result set.
using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor =
- Cache().Query(new SqlQuery(typeof(QueryPerson), "age = 100")))
+ Cache().Query(new SqlQuery(typeof(QueryPerson), "age = 100")))
{
IEnumerator<ICacheEntry<int, QueryPerson>> e = cursor.GetEnumerator();
@@ -251,6 +256,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 4. Page size if less than result set.
qry.PageSize = 2;
CheckEnumeratorQuery(qry);
+#pragma warning restore 618
}
/// <summary>
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 d930b51..99b4f34 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
@@ -206,6 +206,7 @@ namespace Apache.Ignite.Core.Impl.Client.Cache
}
/** <inheritDoc /> */
+ [Obsolete]
public IQueryCursor<ICacheEntry<TK, TV>> Query(SqlQuery sqlQuery)
{
IgniteArgumentCheck.NotNull(sqlQuery, "sqlQuery");
@@ -671,6 +672,7 @@ namespace Apache.Ignite.Core.Impl.Client.Cache
/// <summary>
/// Writes the SQL query.
/// </summary>
+ [Obsolete]
private static void WriteSqlQuery(IBinaryRawWriter writer, SqlQuery qry)
{
Debug.Assert(qry != null);
[ignite] 03/04: Suppress compiler warnings
Posted by pt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 01a59bc35c88f19d7b41176408a3079dc183012d
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:56:51 2019 +0300
Suppress compiler warnings
---
.../Cache/Query/CacheQueriesTest.cs | 16 +++++++++++-----
.../Client/Cache/CacheClientAsyncWrapper.cs | 4 +++-
2 files changed, 14 insertions(+), 6 deletions(-)
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 110fa1e..be35850 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
@@ -265,18 +265,18 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
[Test]
public void TestSqlQueryArguments()
{
+#pragma warning disable 618
Cache().Put(1, new QueryPerson("Ivanov", 30));
Cache().Put(2, new QueryPerson("Petrov", 40));
Cache().Put(3, new QueryPerson("Sidorov", 50));
// 1. Empty result set.
- using (
- IQueryCursor<ICacheEntry<int, QueryPerson>> cursor =
- Cache().Query(new SqlQuery(typeof(QueryPerson), "age < ?", 50)))
+ using (var cursor = Cache().Query(new SqlQuery(typeof(QueryPerson), "age < ?", 50)))
{
foreach (ICacheEntry<int, QueryPerson> entry in cursor.GetAll())
Assert.IsTrue(entry.Key == 1 || entry.Key == 2);
}
+#pragma warning restore 618
}
/// <summary>
@@ -301,6 +301,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
/// Check query result for enumerator test.
/// </summary>
/// <param name="qry">QUery.</param>
+#pragma warning disable 618
private void CheckEnumeratorQuery(SqlQuery qry)
{
using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor = Cache().Query(qry))
@@ -339,6 +340,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Assert.IsTrue(first && second && third);
}
}
+#pragma warning restore 618
/// <summary>
/// Check SQL query.
@@ -353,14 +355,14 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
var exp = PopulateCache(cache, loc, MaxItemCnt, x => x < 50);
// 2. Validate results.
+#pragma warning disable 618
var qry = new SqlQuery(typeof(QueryPerson), "age < 50", loc)
{
EnableDistributedJoins = distrJoin,
-#pragma warning disable 618
ReplicatedOnly = false,
-#pragma warning restore 618
Timeout = TimeSpan.FromSeconds(3)
};
+#pragma warning restore 618
Assert.AreEqual(string.Format("SqlQuery [Sql=age < 50, Arguments=[], Local={0}, " +
"PageSize=1024, EnableDistributedJoins={1}, Timeout={2}, " +
@@ -530,7 +532,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
"Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.", err.Message);
// SQL query.
+#pragma warning disable 618
err = Assert.Throws<IgniteException>(() => cache.Query(new SqlQuery(typeof(QueryPerson), "age < 50")));
+#pragma warning restore 618
Assert.AreEqual("Failed to find SQL table for type: QueryPerson", err.Message);
}
@@ -773,10 +777,12 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
var cache = Cache();
PopulateCache(cache, false, 30000, x => true);
+#pragma warning disable 618
var sqlQry = new SqlQuery(typeof(QueryPerson), "WHERE age < 2000")
{
Timeout = TimeSpan.FromMilliseconds(1)
};
+#pragma warning restore 618
// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
var ex = Assert.Throws<CacheException>(() => cache.Query(sqlQry).ToArray());
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
index 6d812cf..8ad4478 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
@@ -134,10 +134,12 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
}
/** <inheritDoc /> */
+#pragma warning disable 618
public IQueryCursor<ICacheEntry<TK, TV>> Query(SqlQuery sqlQuery)
{
return _cache.Query(sqlQuery);
}
+#pragma warning restore 618
/** <inheritDoc /> */
public IFieldsQueryCursor Query(SqlFieldsQuery sqlFieldsQuery)
@@ -349,4 +351,4 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
return _cache.WithKeepBinary<TK1, TV1>();
}
}
-}
\ No newline at end of file
+}
[ignite] 01/04: Mark APIs as Obsolete
Posted by pt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 354e8fe09a2064239895166a33c6d645389fb6d3
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:52:24 2019 +0300
Mark APIs as Obsolete
---
modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs | 2 ++
.../platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs | 2 ++
2 files changed, 4 insertions(+)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs
index 4c979ed..d0e77ca 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs
@@ -27,6 +27,8 @@ namespace Apache.Ignite.Core.Cache.Query
/// <summary>
/// SQL Query.
/// </summary>
+ [Obsolete("Use SqlFieldsQuery instead. For strongly-typed queries use Apache.Ignite.Linq. " +
+ "SqlQuery is a limited subset of SqlFieldsQuery.")]
public class SqlQuery : QueryBase
{
/// <summary>
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
index 818a7f6..ab98e15 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
@@ -154,6 +154,8 @@ namespace Apache.Ignite.Core.Client.Cache
/// </summary>
/// <param name="sqlQuery">SQL query.</param>
/// <returns>Query cursor.</returns>
+ [Obsolete("Use SqlFieldsQuery instead. For strongly-typed queries use Apache.Ignite.Linq. " +
+ "SqlQuery is a limited subset of SqlFieldsQuery.")]
IQueryCursor<ICacheEntry<TK, TV>> Query(SqlQuery sqlQuery);
/// <summary>
[ignite] 04/04: Suppress compiler warnings - done
Posted by pt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit d3e7b15eb216072636c0fade446b2b482b9f3759
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:58:29 2019 +0300
Suppress compiler warnings - done
---
.../dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheTestNoMeta.cs | 2 ++
.../dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTest.cs | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheTestNoMeta.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheTestNoMeta.cs
index 1978243..0c72010 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheTestNoMeta.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheTestNoMeta.cs
@@ -71,10 +71,12 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
Assert.AreEqual(200, serverCache[2].Id);
// SQL from server cache.
+#pragma warning disable 618
var sqlRes = serverCache.Query(new SqlQuery(typeof(Person), "where id = 100")).GetAll().Single();
Assert.AreEqual(1, sqlRes.Key);
Assert.AreEqual(100, sqlRes.Value.Id);
Assert.AreEqual("foo", sqlRes.Value.Name);
+#pragma warning restore 618
}
}
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 760a48d..9584af8 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
@@ -34,6 +34,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
[Test]
public void TestSqlQuery()
{
+#pragma warning disable 618
var cache = GetClientCache<Person>();
// All items.
@@ -63,6 +64,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
qry.Sql = "abc";
qry.QueryType = null;
Assert.Throws<ArgumentNullException>(() => cache.Query(qry));
+#pragma warning restore 618
}
/// <summary>
@@ -71,6 +73,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
[Test]
public void TestSqlQueryDistributedJoins()
{
+#pragma warning disable 618
var cache = GetClientCache<Person>();
// Non-distributed join returns incomplete results.
@@ -83,6 +86,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
// Distributed join fixes the problem.
qry.EnableDistributedJoins = true;
Assert.AreEqual(Count, cache.Query(qry).Count());
+#pragma warning restore 618
}
/// <summary>