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 2016/12/28 08:40:39 UTC

ignite git commit: IGNITE-4307 .NET: Fix AtomicConfiguration in AtomicSequenceExample

Repository: ignite
Updated Branches:
  refs/heads/master 8dd03222f -> 06ef84606


IGNITE-4307 .NET: Fix AtomicConfiguration in AtomicSequenceExample


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/06ef8460
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/06ef8460
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/06ef8460

Branch: refs/heads/master
Commit: 06ef846067411350081c4112ef9e9466deb6086c
Parents: 8dd0322
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Dec 28 11:29:30 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Dec 28 11:29:30 2016 +0300

----------------------------------------------------------------------
 .../examples/Apache.Ignite.Examples/App.config  |  2 ++
 .../DataStructures/AtomicSequenceExample.cs     | 26 +++-----------------
 2 files changed, 6 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/06ef8460/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
index 8b16df3..13f0d86 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/App.config
@@ -40,6 +40,8 @@
                 <string>Apache.Ignite.ExamplesDll.Compute.AverageSalaryJob</string>
             </types>
         </binaryConfiguration>
+
+        <atomicConfiguration atomicSequenceReserveSize="10" />
         
         <discoverySpi type="TcpDiscoverySpi">
             <ipFinder type="TcpDiscoveryMulticastIpFinder">

http://git-wip-us.apache.org/repos/asf/ignite/blob/06ef8460/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
index f08c998..89e8ed3 100644
--- a/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
+++ b/modules/platforms/dotnet/examples/Apache.Ignite.Examples/DataStructures/AtomicSequenceExample.cs
@@ -21,9 +21,6 @@ namespace Apache.Ignite.Examples.DataStructures
     using System.Threading;
     using Apache.Ignite.Core;
     using Apache.Ignite.Core.DataStructures;
-    using Apache.Ignite.Core.DataStructures.Configuration;
-    using Apache.Ignite.Core.Discovery.Tcp;
-    using Apache.Ignite.Core.Discovery.Tcp.Multicast;
     using Apache.Ignite.ExamplesDll.DataStructures;
 
     /// <summary>
@@ -44,26 +41,11 @@ namespace Apache.Ignite.Examples.DataStructures
         [STAThread]
         public static void Main()
         {
-            var atomicCfg = new AtomicConfiguration
-            {
-                // Each node reserves 10 numbers to itself, so that 10 increments can be done locally, 
-                // without communicating to other nodes. After that, another 10 elements are reserved.
-                AtomicSequenceReserveSize = 10
-            };
-
-            var cfg = new IgniteConfiguration
-            {
-                DiscoverySpi = new TcpDiscoverySpi
-                {
-                    IpFinder = new TcpDiscoveryMulticastIpFinder
-                    {
-                        Endpoints = new[] { "127.0.0.1:47500" }
-                    }
-                },
-                AtomicConfiguration = atomicCfg
-            };
+            // See app.config: <atomicConfiguration atomicSequenceReserveSize="10" />
+            // Each node reserves 10 numbers to itself, so that 10 increments can be done locally, 
+            // without communicating to other nodes. After that, another 10 elements are reserved.
 
-            using (var ignite = Ignition.Start(cfg))
+            using (var ignite = Ignition.StartFromApplicationConfiguration())
             {
                 Console.WriteLine();
                 Console.WriteLine(">>> Atomic sequence example started.");