Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED55519785 for ; Sun, 3 Apr 2016 19:42:26 +0000 (UTC) Received: (qmail 55800 invoked by uid 500); 3 Apr 2016 19:42:26 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 55643 invoked by uid 500); 3 Apr 2016 19:42:26 -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 55080 invoked by uid 99); 3 Apr 2016 19:42:26 -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; Sun, 03 Apr 2016 19:42:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EE431E07F6; Sun, 3 Apr 2016 19:42:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Sun, 03 Apr 2016 19:42:41 -0000 Message-Id: <765ff5a7f5764645aa5e349aa3377d1c@git.apache.org> In-Reply-To: <659950b9cbd44eaaa10758c965d5554d@git.apache.org> References: <659950b9cbd44eaaa10758c965d5554d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/50] [abbrv] ignite git commit: IGNITE-2550: .NET: Simplified examples configuration. This closes #570. IGNITE-2550: .NET: Simplified examples configuration. This closes #570. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc34e51a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc34e51a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc34e51a Branch: refs/heads/ignite-2407 Commit: fc34e51a265e73675ff8768526c9f22c9cd9b6fb Parents: f17b2ae Author: Pavel Tupitsyn Authored: Tue Mar 29 10:04:30 2016 +0300 Committer: vozerov-gridgain Committed: Tue Mar 29 10:04:30 2016 +0300 ---------------------------------------------------------------------- modules/platforms/dotnet/Apache.Ignite.sln | 5 +- .../Compute/ClosureExample.cs | 4 +- .../Compute/TaskExample.cs | 4 +- .../Datagrid/ContinuousQueryExample.cs | 11 +- .../Datagrid/DataStreamerExample.cs | 8 +- .../Datagrid/PutGetExample.cs | 6 +- .../Datagrid/QueryExample.cs | 20 +++- .../Datagrid/StoreExample.cs | 16 ++- .../Datagrid/TransactionExample.cs | 14 ++- .../Events/EventsExample.cs | 6 +- .../Messaging/MessagingExample.cs | 4 +- .../Misc/LifecycleExample.cs | 2 +- .../Services/ServicesExample.cs | 6 +- .../Apache.Ignite.ExamplesDll.csproj | 1 + .../Apache.Ignite.ExamplesDll/Binary/Account.cs | 1 - .../Apache.Ignite.ExamplesDll/Binary/Address.cs | 5 +- .../Binary/Employee.cs | 4 + .../Binary/EmployeeKey.cs | 4 +- .../Binary/Organization.cs | 11 +- .../Binary/OrganizationType.cs | 3 - .../Datagrid/EmployeeStoreFactory.cs | 38 ++++++ .../examples/Config/example-cache-query.xml | 118 ------------------- .../examples/Config/example-cache-store.xml | 59 ---------- .../dotnet/examples/Config/example-cache.xml | 87 -------------- .../dotnet/examples/Config/example-compute.xml | 70 ----------- .../dotnet/examples/Config/examples-config.xml | 98 +++++++++++++++ 26 files changed, 217 insertions(+), 388 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/Apache.Ignite.sln ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln index a28d714..12fd82b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.sln +++ b/modules/platforms/dotnet/Apache.Ignite.sln @@ -28,10 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Apache.Ignite.sln.TeamCity.DotSettings = Apache.Ignite.sln.TeamCity.DotSettings build.bat = build.bat DEVNOTES.txt = DEVNOTES.txt - examples\Config\example-cache-query.xml = examples\Config\example-cache-query.xml - examples\Config\example-cache-store.xml = examples\Config\example-cache-store.xml - examples\Config\example-cache.xml = examples\Config\example-cache.xml - examples\Config\example-compute.xml = examples\Config\example-compute.xml + examples\Config\examples-config.xml = examples\Config\examples-config.xml README.txt = README.txt EndProjectSection EndProject http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs index e1194f8..7675b7e 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/ClosureExample.cs @@ -34,7 +34,7 @@ namespace Apache.Ignite.Examples.Compute /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class ClosureExample @@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Compute { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs index f0bcf13..7934e82 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Compute/TaskExample.cs @@ -35,7 +35,7 @@ namespace Apache.Ignite.Examples.Compute /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class TaskExample @@ -48,7 +48,7 @@ namespace Apache.Ignite.Examples.Compute { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs index 8dad1f4..b253b3f 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/ContinuousQueryExample.cs @@ -36,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class ContinuousQueryExample { + /// Cache name. + private const string CacheName = "dotnet_cache_continuous_query"; + /// /// Runs the example. /// @@ -49,8 +52,8 @@ namespace Apache.Ignite.Examples.Datagrid { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml", - JvmOptions = new List {"-Xms512m", "-Xmx512m" } + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", + JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; using (var ignite = Ignition.Start(cfg)) @@ -58,7 +61,7 @@ namespace Apache.Ignite.Examples.Datagrid Console.WriteLine(); Console.WriteLine(">>> Cache continuous query example started."); - var cache = ignite.GetOrCreateCache("cache_continuous_query"); + var cache = ignite.GetOrCreateCache(CacheName); // Clean up caches on all nodes before run. cache.Clear(); http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs index 08a670f..9315f02 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/DataStreamerExample.cs @@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class DataStreamerExample @@ -47,7 +47,7 @@ namespace Apache.Ignite.Examples.Datagrid private const int EntryCount = 500000; /// Cache name. - private const string CacheName = "cache_data_streamer"; + private const string CacheName = "dotnet_cache_data_streamer"; /// /// Runs the example. @@ -57,8 +57,8 @@ namespace Apache.Ignite.Examples.Datagrid { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml", - JvmOptions = new List {"-Xms512m", "-Xmx512m" } + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", + JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; using (var ignite = Ignition.Start(cfg)) http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs index e2502e8..7d5ade6 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs @@ -38,13 +38,13 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class PutGetExample { /// Cache name. - private const string CacheName = "cache_put_get"; + private const string CacheName = "dotnet_cache_put_get"; /// /// Runs the example. @@ -54,7 +54,7 @@ namespace Apache.Ignite.Examples.Datagrid { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs index 809eb65..c9166b2 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/QueryExample.cs @@ -24,6 +24,7 @@ using Apache.Ignite.Core.Cache.Query; namespace Apache.Ignite.Examples.Datagrid { + using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.ExamplesDll.Binary; /// @@ -38,17 +39,20 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-query.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class QueryExample { + /// Cache name. + private const string CacheName = "dotnet_cache_query"; + [STAThread] public static void Main() { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-query.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; @@ -57,7 +61,15 @@ namespace Apache.Ignite.Examples.Datagrid Console.WriteLine(); Console.WriteLine(">>> Cache query example started."); - var cache = ignite.GetCache(null); + var cache = ignite.GetOrCreateCache(new CacheConfiguration + { + Name = CacheName, + QueryEntities = new[] + { + new QueryEntity(typeof(int), typeof(Organization)), + new QueryEntity(typeof(EmployeeKey), typeof(Employee)) + } + }); // Clean up caches on all nodes before run. cache.Clear(); @@ -66,7 +78,7 @@ namespace Apache.Ignite.Examples.Datagrid PopulateCache(cache); // Create cache that will work with specific types. - var employeeCache = ignite.GetCache(null); + var employeeCache = ignite.GetCache(CacheName); // Run SQL query example. SqlQueryExample(employeeCache); http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs index 1654b41..e3ccecc 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/StoreExample.cs @@ -22,6 +22,7 @@ using Apache.Ignite.ExamplesDll.Datagrid; namespace Apache.Ignite.Examples.Datagrid { + using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.ExamplesDll.Binary; /// @@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache-store.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// class StoreExample { + /// Cache name. + private const string CacheName = "dotnet_cache_with_store"; + /// /// Runs the example. /// @@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache-store.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; @@ -57,7 +61,13 @@ namespace Apache.Ignite.Examples.Datagrid Console.WriteLine(); Console.WriteLine(">>> Cache store example started."); - var cache = ignite.GetCache(null); + var cache = ignite.GetOrCreateCache(new CacheConfiguration + { + Name = CacheName, + ReadThrough = true, + WriteThrough = true, + CacheStoreFactory = new EmployeeStoreFactory() + }); // Clean up caches on all nodes before run. cache.Clear(); http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs index e814f8c..2aa5fd7 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/TransactionExample.cs @@ -22,6 +22,7 @@ using Apache.Ignite.Core.Transactions; namespace Apache.Ignite.Examples.Datagrid { + using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.ExamplesDll.Binary; /// @@ -35,11 +36,14 @@ namespace Apache.Ignite.Examples.Datagrid /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// class TransactionExample { + /// Cache name. + private const string CacheName = "dotnet_cache_tx"; + /// /// Runs the example. /// @@ -48,7 +52,7 @@ namespace Apache.Ignite.Examples.Datagrid { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-cache.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; @@ -57,7 +61,11 @@ namespace Apache.Ignite.Examples.Datagrid Console.WriteLine(); Console.WriteLine(">>> Transaction example started."); - var cache = ignite.GetCache("tx"); + var cache = ignite.GetOrCreateCache(new CacheConfiguration + { + Name = CacheName, + AtomicityMode = CacheAtomicityMode.Transactional + }); // Clean up caches on all nodes before run. cache.Clear(); http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs index 3b068e8..f571db5 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Events/EventsExample.cs @@ -38,7 +38,7 @@ namespace Apache.Ignite.Examples.Events /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class EventsExample @@ -51,8 +51,8 @@ namespace Apache.Ignite.Examples.Events { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", - JvmOptions = new List {"-Xms512m", "-Xmx512m" } + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", + JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; using (var ignite = Ignition.Start(cfg)) http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs index 6438b95..0c94a7b 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Messaging/MessagingExample.cs @@ -29,7 +29,7 @@ namespace Apache.Ignite.Examples.Messaging /// 1) Build the project Apache.Ignite.ExamplesDll (select it -> right-click -> Build). /// Apache.Ignite.ExamplesDll.dll must appear in %IGNITE_HOME%/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/bin/${Platform]/${Configuration} folder; /// 2) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 3) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties -> /// Application -> Startup object); /// 4) Start example (F5 or Ctrl+F5). @@ -44,7 +44,7 @@ namespace Apache.Ignite.Examples.Messaging { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs index bba6719..3dc5820 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Misc/LifecycleExample.cs @@ -50,7 +50,7 @@ namespace Apache.Ignite.Examples.Misc var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", JvmOptions = new List { "-Xms512m", "-Xmx512m" }, LifecycleBeans = new List { lifecycleExampleBean } }; http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs index e57774c..c6c71dd 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Services/ServicesExample.cs @@ -33,7 +33,7 @@ namespace Apache.Ignite.Examples.Services /// /// This example can be run with standalone Apache Ignite.NET node: /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe: - /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] + /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\examples-config.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll] /// 2) Start example. /// public class ServicesExample @@ -46,8 +46,8 @@ namespace Apache.Ignite.Examples.Services { var cfg = new IgniteConfiguration { - SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml", - JvmOptions = new List {"-Xms512m", "-Xmx512m"} + SpringConfigUrl = @"platforms\dotnet\examples\config\examples-config.xml", + JvmOptions = new List { "-Xms512m", "-Xmx512m" } }; using (var ignite = Ignition.Start(cfg)) http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj index ccbdf4b..1cf729b 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj @@ -55,6 +55,7 @@ + http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs index f51c3c2..4d3fc35 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Account.cs @@ -22,7 +22,6 @@ namespace Apache.Ignite.ExamplesDll.Binary /// /// Account object. Used in transaction example. /// - [Serializable] public class Account { /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs index 0490f24..bb6ed7f 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Address.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.ExamplesDll.Binary { using System; using Apache.Ignite.Core.Binary; + using Apache.Ignite.Core.Cache.Configuration; /// /// Address. @@ -36,15 +37,17 @@ namespace Apache.Ignite.ExamplesDll.Binary Street = street; Zip = zip; } - + /// /// Street. /// + [QueryTextField] public string Street { get; set; } /// /// ZIP code. /// + [QuerySqlField(IsIndexed = true)] public int Zip { get; set; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs index 7d0af08..44a3f11 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Employee.cs @@ -20,6 +20,7 @@ namespace Apache.Ignite.ExamplesDll.Binary using System; using System.Collections.Generic; using System.Linq; + using Apache.Ignite.Core.Cache.Configuration; /// /// Employee. @@ -45,16 +46,19 @@ namespace Apache.Ignite.ExamplesDll.Binary /// /// Name. /// + [QuerySqlField] public string Name { get; set; } /// /// Salary. /// + [QuerySqlField] public long Salary { get; set; } /// /// Address. /// + [QuerySqlField] public Address Address { get; set; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs index 16e5469..9c1d8cc 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/EmployeeKey.cs @@ -17,13 +17,12 @@ namespace Apache.Ignite.ExamplesDll.Binary { - using System; using Apache.Ignite.Core.Cache.Affinity; + using Apache.Ignite.Core.Cache.Configuration; /// /// Employee key. Used in query example to co-locate employees with their organizations. /// - [Serializable] public class EmployeeKey { /// @@ -46,6 +45,7 @@ namespace Apache.Ignite.ExamplesDll.Binary /// Organization ID. /// [AffinityKeyMapped] + [QuerySqlField(IsIndexed = true)] public int OrganizationId { get; private set; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs index 060966a..16d4113 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/Organization.cs @@ -18,22 +18,14 @@ namespace Apache.Ignite.ExamplesDll.Binary { using System; + using Apache.Ignite.Core.Cache.Configuration; /// /// Organization. /// - [Serializable] public class Organization { /// - /// Default constructor. - /// - public Organization() - { - // No-op. - } - - /// /// Constructor. /// /// Name. @@ -51,6 +43,7 @@ namespace Apache.Ignite.ExamplesDll.Binary /// /// Name. /// + [QuerySqlField(IsIndexed = true)] public string Name { get; set; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs index 9ff0c3a..098fab9 100644 --- a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Binary/OrganizationType.cs @@ -17,12 +17,9 @@ namespace Apache.Ignite.ExamplesDll.Binary { - using System; - /// /// Organization type. /// - [Serializable] public enum OrganizationType { /// http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs new file mode 100644 index 0000000..643fc44 --- /dev/null +++ b/modules/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStoreFactory.cs @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace Apache.Ignite.ExamplesDll.Datagrid +{ + using System; + using Apache.Ignite.Core.Cache.Store; + using Apache.Ignite.Core.Common; + + /// + /// Employee store factory. + /// + [Serializable] + public class EmployeeStoreFactory : IFactory + { + /// + /// Creates an instance of the cache store. + /// + public ICacheStore CreateInstance() + { + return new EmployeeStore(); + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-query.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Config/example-cache-query.xml b/modules/platforms/dotnet/examples/Config/example-cache-query.xml deleted file mode 100644 index 5bc9399..0000000 --- a/modules/platforms/dotnet/examples/Config/example-cache-query.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - Apache.Ignite.ExamplesDll.Binary.Account - Apache.Ignite.ExamplesDll.Binary.Address - Apache.Ignite.ExamplesDll.Binary.Employee - Apache.Ignite.ExamplesDll.Binary.EmployeeKey - Apache.Ignite.ExamplesDll.Binary.Organization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 127.0.0.1:47500..47501 - - - - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache-store.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Config/example-cache-store.xml b/modules/platforms/dotnet/examples/Config/example-cache-store.xml deleted file mode 100644 index 2c20531..0000000 --- a/modules/platforms/dotnet/examples/Config/example-cache-store.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 127.0.0.1:47500..47501 - - - - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-cache.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Config/example-cache.xml b/modules/platforms/dotnet/examples/Config/example-cache.xml deleted file mode 100644 index 949f3a4..0000000 --- a/modules/platforms/dotnet/examples/Config/example-cache.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - Apache.Ignite.ExamplesDll.Binary.Account - Apache.Ignite.ExamplesDll.Binary.Address - Apache.Ignite.ExamplesDll.Binary.Employee - Apache.Ignite.ExamplesDll.Binary.EmployeeKey - Apache.Ignite.ExamplesDll.Binary.Organization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 127.0.0.1:47500..47501 - - - - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/example-compute.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Config/example-compute.xml b/modules/platforms/dotnet/examples/Config/example-compute.xml deleted file mode 100644 index bbc6550..0000000 --- a/modules/platforms/dotnet/examples/Config/example-compute.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - 127.0.0.1:47500..47501 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/fc34e51a/modules/platforms/dotnet/examples/Config/examples-config.xml ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/examples/Config/examples-config.xml b/modules/platforms/dotnet/examples/Config/examples-config.xml new file mode 100644 index 0000000..04e6a26 --- /dev/null +++ b/modules/platforms/dotnet/examples/Config/examples-config.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + 127.0.0.1:47500..47501 + + + + + + + + + + + + + + + Apache.Ignite.ExamplesDll.Binary.Account + Apache.Ignite.ExamplesDll.Binary.Address + Apache.Ignite.ExamplesDll.Binary.Employee + Apache.Ignite.ExamplesDll.Binary.EmployeeKey + Apache.Ignite.ExamplesDll.Binary.Organization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +