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 058BE200C80 for ; Thu, 25 May 2017 17:46:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 04005160BCA; Thu, 25 May 2017 15:46:06 +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 238F9160BC7 for ; Thu, 25 May 2017 17:46:04 +0200 (CEST) Received: (qmail 38413 invoked by uid 500); 25 May 2017 15:46:04 -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 38403 invoked by uid 99); 25 May 2017 15:46:04 -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, 25 May 2017 15:46:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3FC88DFB01; Thu, 25 May 2017 15:46:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ptupitsyn@apache.org To: commits@ignite.apache.org Message-Id: <7937ca83b15144af8c98a8723852ec71@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: .NET: Remove dead code from old LINQ CompiledQuery Date: Thu, 25 May 2017 15:46:04 +0000 (UTC) archived-at: Thu, 25 May 2017 15:46:06 -0000 Repository: ignite Updated Branches: refs/heads/master db7d776ad -> 49fcd2cce .NET: Remove dead code from old LINQ CompiledQuery Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/49fcd2cc Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/49fcd2cc Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/49fcd2cc Branch: refs/heads/master Commit: 49fcd2cced1f7b5117b8f1a4fca252b31e2c9b90 Parents: db7d776 Author: Pavel Tupitsyn Authored: Thu May 25 18:45:51 2017 +0300 Committer: Pavel Tupitsyn Committed: Thu May 25 18:45:51 2017 +0300 ---------------------------------------------------------------------- .../Impl/CacheFieldsQueryExecutor.cs | 39 -------------------- .../Impl/CacheQueryableBase.cs | 14 ++----- .../Impl/ICacheQueryableInternal.cs | 6 --- 3 files changed, 3 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/49fcd2cc/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs index 27082bd..bc7251b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheFieldsQueryExecutor.cs @@ -93,45 +93,6 @@ namespace Apache.Ignite.Linq.Impl } /// - /// Compiles the query (old method, does not support some scenarios). - /// - public Func> CompileQuery(QueryModel queryModel, Delegate queryCaller) - { - Debug.Assert(queryModel != null); - Debug.Assert(queryCaller != null); - - var qryData = GetQueryData(queryModel); - - var qryText = qryData.QueryText; - - var selector = GetResultSelector(queryModel.SelectClause.Selector); - - // Compiled query is a delegate with query parameters - // Delegate parameters order and query parameters order may differ - - // These are in order of usage in query - var qryOrderParams = qryData.ParameterExpressions.OfType() - .Select(x => x.Member.Name).ToList(); - - // These are in order they come from user - var userOrderParams = queryCaller.Method.GetParameters().Select(x => x.Name).ToList(); - - if ((qryOrderParams.Count != qryData.Parameters.Count) || - (qryOrderParams.Count != userOrderParams.Count)) - throw new InvalidOperationException("Error compiling query: all compiled query arguments " + - "should come from enclosing delegate parameters."); - - var indices = qryOrderParams.Select(x => userOrderParams.IndexOf(x)).ToArray(); - - // Check if user param order is already correct - if (indices.SequenceEqual(Enumerable.Range(0, indices.Length))) - return args => _cache.QueryFields(GetFieldsQuery(qryText, args), selector); - - // Return delegate with reorder - return args => _cache.QueryFields(GetFieldsQuery(qryText, - args.Select((x, i) => args[indices[i]]).ToArray()), selector); - } - /// /// Compiles the query without regard to number or order of arguments. /// public Func> CompileQuery(QueryModel queryModel) http://git-wip-us.apache.org/repos/asf/ignite/blob/49fcd2cc/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryableBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryableBase.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryableBase.cs index 21a7850..5702f4f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryableBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/CacheQueryableBase.cs @@ -28,16 +28,16 @@ namespace Apache.Ignite.Linq.Impl /// /// Base class for cache queryables. /// - internal class CacheQueryableBase : QueryableBase, ICacheQueryableInternal + internal abstract class CacheQueryableBase : QueryableBase, ICacheQueryableInternal { /** */ - public CacheQueryableBase(IQueryProvider provider) : base(provider) + protected CacheQueryableBase(IQueryProvider provider) : base(provider) { // No-op. } /** */ - public CacheQueryableBase(IQueryProvider provider, Expression expression) : base(provider, expression) + protected CacheQueryableBase(IQueryProvider provider, Expression expression) : base(provider, expression) { // No-op. } @@ -82,14 +82,6 @@ namespace Apache.Ignite.Linq.Impl } /** */ - public Func> CompileQuery(Delegate queryCaller) - { - var executor = CacheQueryProvider.Executor; - - return executor.CompileQuery(GetQueryModel(), queryCaller); - } - - /** */ public Func> CompileQuery(LambdaExpression queryExpression) { var executor = CacheQueryProvider.Executor; http://git-wip-us.apache.org/repos/asf/ignite/blob/49fcd2cc/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/ICacheQueryableInternal.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/ICacheQueryableInternal.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/ICacheQueryableInternal.cs index ffc81b4..b24bc5c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/ICacheQueryableInternal.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/ICacheQueryableInternal.cs @@ -47,12 +47,6 @@ namespace Apache.Ignite.Linq.Impl QueryModel GetQueryModel(); /// - /// Compiles the query (the old way). - /// - /// Caller expression to examine argument order. - Func> CompileQuery(Delegate queryCaller); - - /// /// Compiles the query. /// /// The query expression.