Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A62E6200C48 for ; Thu, 6 Apr 2017 15:31:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A504D160BC9; Thu, 6 Apr 2017 13:31:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A8C13160BA9 for ; Thu, 6 Apr 2017 15:31:13 +0200 (CEST) Received: (qmail 95297 invoked by uid 500); 6 Apr 2017 13:31:12 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 94794 invoked by uid 99); 6 Apr 2017 13:31:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2017 13:31:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 21ECDE9639; Thu, 6 Apr 2017 13:31:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Thu, 06 Apr 2017 13:31:17 -0000 Message-Id: In-Reply-To: <358816612602444bb6656810c8375230@git.apache.org> References: <358816612602444bb6656810c8375230@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [10/50] [abbrv] ignite git commit: IGNITE-3506 .NET: Fix ContinuousQuery, QueryBase, and SqlFieldsQuery class constants archived-at: Thu, 06 Apr 2017 13:31:14 -0000 IGNITE-3506 .NET: Fix ContinuousQuery, QueryBase, and SqlFieldsQuery class constants This closes #1695 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2ad2365a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2ad2365a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2ad2365a Branch: refs/heads/ignite-2893 Commit: 2ad2365a03686530ab10993966e7153105380fa9 Parents: b44432d Author: Pavel Tupitsyn Authored: Fri Mar 31 14:51:57 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Mar 31 14:51:57 2017 +0300 ---------------------------------------------------------------------- .../Cache/Query/CacheLinqTest.cs | 2 +- .../Cache/Query/CacheQueriesTest.cs | 2 + .../Continuous/ContinuousQueryAbstractTest.cs | 14 +++++ .../Cache/Query/Continuous/ContinuousQuery.cs | 59 +++++++++++--------- .../Apache.Ignite.Core/Cache/Query/QueryBase.cs | 4 +- .../Cache/Query/SqlFieldsQuery.cs | 6 +- .../dotnet/Apache.Ignite.Linq/QueryOptions.cs | 2 +- 7 files changed, 57 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs index 8acf89c..856fb49 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs @@ -1250,7 +1250,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query fq = fieldsQuery.GetFieldsQuery(); Assert.AreEqual("select _T0.Name from \"\".Person as _T0", fq.Sql); Assert.IsFalse(fq.Local); - Assert.AreEqual(SqlFieldsQuery.DfltPageSize, fq.PageSize); + Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize); Assert.IsFalse(fq.EnableDistributedJoins); Assert.IsFalse(fq.EnforceJoinOrder); http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs ---------------------------------------------------------------------- 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 4061ac2..fc47f52 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 @@ -245,6 +245,8 @@ namespace Apache.Ignite.Core.Tests.Cache.Query SqlQuery qry = new SqlQuery(typeof (QueryPerson), "age < 60"); + Assert.AreEqual(QueryBase.DefaultPageSize, qry.PageSize); + // 2. Page size is bigger than result set. qry.PageSize = 4; CheckEnumeratorQuery(qry); http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs index 40d8525..e890198 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs @@ -290,6 +290,20 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous } /// + /// Tests the defaults. + /// + [Test] + public void TestDefaults() + { + var qry = new ContinuousQuery(null); + + Assert.AreEqual(ContinuousQuery.DefaultAutoUnsubscribe, qry.AutoUnsubscribe); + Assert.AreEqual(ContinuousQuery.DefaultBufferSize, qry.BufferSize); + Assert.AreEqual(ContinuousQuery.DefaultTimeInterval, qry.TimeInterval); + Assert.IsFalse(qry.Local); + } + + /// /// Check filter. /// /// Binarizable. http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs index 3bb136e..81913c8 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs @@ -18,10 +18,38 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous { using System; - using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cache.Event; /// + /// Continuous query base class, see . + /// + public abstract class ContinuousQuery + { + /// + /// Initializes a new instance of the class. + /// + protected internal ContinuousQuery() + { + // No-op. + } + + /// + /// Default buffer size. + /// + public const int DefaultBufferSize = 1; + + /// + /// Default time interval. + /// + public static readonly TimeSpan DefaultTimeInterval = new TimeSpan(0); + + /// + /// Default auto-unsubscribe flag value. + /// + public const bool DefaultAutoUnsubscribe = true; + } + + /// /// API for configuring continuous cache queries. /// /// Continuous queries allow to register a remote and a listener for cache update events. @@ -36,28 +64,9 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous /// To execute the query use method /// . /// - public class ContinuousQuery + public class ContinuousQuery : ContinuousQuery { /// - /// Default buffer size. - /// - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public const int DfltBufSize = 1; - - /// - /// Default time interval. - /// - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - [SuppressMessage("ReSharper", "StaticMemberInGenericType")] - public static readonly TimeSpan DfltTimeInterval = new TimeSpan(0); - - /// - /// Default auto-unsubscribe flag value. - /// - [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] - public const bool DfltAutoUnsubscribe = true; - - /// /// Constructor. /// /// Listener. @@ -99,9 +108,9 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous Filter = filter; Local = loc; - BufferSize = DfltBufSize; - TimeInterval = DfltTimeInterval; - AutoUnsubscribe = DfltAutoUnsubscribe; + BufferSize = DefaultBufferSize; + TimeInterval = DefaultTimeInterval; + AutoUnsubscribe = DefaultAutoUnsubscribe; } /// @@ -124,7 +133,7 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous /// Entries from buffer will be sent to the master node only if the buffer is /// full or time provided via is exceeded. /// - /// Defaults to + /// Defaults to /// public int BufferSize { get; set; } http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs index d992845..e4ab6e0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs @@ -28,14 +28,14 @@ namespace Apache.Ignite.Core.Cache.Query public abstract class QueryBase { /// Default page size. - public const int DfltPageSize = 1024; + public const int DefaultPageSize = 1024; /// /// Initializes a new instance of the class. /// protected internal QueryBase() { - PageSize = DfltPageSize; + PageSize = DefaultPageSize; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs ---------------------------------------------------------------------- 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 1d896b8..aab2bfe 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlFieldsQuery.cs @@ -26,7 +26,7 @@ namespace Apache.Ignite.Core.Cache.Query public class SqlFieldsQuery { /// Default page size. - public const int DfltPageSize = 1024; + public const int DefaultPageSize = 1024; /// /// Constructor. @@ -50,7 +50,7 @@ namespace Apache.Ignite.Core.Cache.Query Local = loc; Arguments = args; - PageSize = DfltPageSize; + PageSize = DefaultPageSize; } /// @@ -75,7 +75,7 @@ namespace Apache.Ignite.Core.Cache.Query /// /// Optional page size. /// - /// Defaults to . + /// Defaults to . /// public int PageSize { get; set; } http://git-wip-us.apache.org/repos/asf/ignite/blob/2ad2365a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs index 4fe3ee5..c70152e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/QueryOptions.cs @@ -27,7 +27,7 @@ namespace Apache.Ignite.Linq public class QueryOptions { /// Default page size. - public const int DefaultPageSize = SqlFieldsQuery.DfltPageSize; + public const int DefaultPageSize = SqlFieldsQuery.DefaultPageSize; /// /// Initializes a new instance of the class.