You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/09/22 09:19:11 UTC
[09/37] ignite git commit: IGNITE-1513: WIP on .Net.
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Messaging/MessagingExample.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Messaging/MessagingExample.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Messaging/MessagingExample.cs
deleted file mode 100644
index a24c47c..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Messaging/MessagingExample.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using Apache.Ignite.Core;
-using Apache.Ignite.ExamplesDll.Messaging;
-
-namespace Apache.Ignite.Examples.Messaging
-{
- /// <summary>
- /// Example demonstrating Ignite messaging. Should be run with standalone Apache Ignite .Net node.
- /// <para />
- /// 1) Run %IGNITE_HOME%/platforms/dotnet/Apache.Ignite/bin/${Platform]/${Configuration}/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-compute.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
- /// 2) 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.
- /// 3) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties ->
- /// Application -> Startup object);
- /// 4) Start example (F5 or Ctrl+F5).
- /// </summary>
- public class MessagingExample
- {
- /// <summary>
- /// Runs the example.
- /// </summary>
- [STAThread]
- public static void Main()
- {
- var cfg = new IgniteConfiguration
- {
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
- JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" }
- };
-
- using (var ignite = Ignition.Start(cfg))
- {
- var remotes = ignite.GetCluster().ForRemotes();
-
- if (remotes.GetNodes().Count == 0)
- {
- Console.WriteLine(">>> This example requires remote nodes to be started.");
- Console.WriteLine(">>> Please start at least 1 remote node.");
- Console.WriteLine(">>> Refer to example's documentation for details on configuration.");
- }
- else
- {
- Console.WriteLine(">>> Messaging example started.");
- Console.WriteLine();
-
- // Set up local listeners
- var localMessaging = ignite.GetCluster().ForLocal().GetMessaging();
-
- var msgCount = remotes.GetNodes().Count * 10;
-
- var orderedCounter = new CountdownEvent(msgCount);
- var unorderedCounter = new CountdownEvent(msgCount);
-
- localMessaging.LocalListen(new LocalListener(unorderedCounter), Topic.Unordered);
- localMessaging.LocalListen(new LocalListener(orderedCounter), Topic.Ordered);
-
- // Set up remote listeners
- var remoteMessaging = remotes.GetMessaging();
-
- remoteMessaging.RemoteListen(new RemoteUnorderedListener(), Topic.Unordered);
- remoteMessaging.RemoteListen(new RemoteOrderedListener(), Topic.Ordered);
-
- // Send unordered
- Console.WriteLine(">>> Sending unordered messages...");
-
- for (var i = 0; i < 10; i++)
- remoteMessaging.Send(i, Topic.Unordered);
-
- Console.WriteLine(">>> Finished sending unordered messages.");
-
- // Send ordered
- Console.WriteLine(">>> Sending ordered messages...");
-
- for (var i = 0; i < 10; i++)
- remoteMessaging.SendOrdered(i, Topic.Ordered);
-
- Console.WriteLine(">>> Finished sending ordered messages.");
-
- Console.WriteLine(">>> Check output on all nodes for message printouts.");
- Console.WriteLine(">>> Waiting for messages acknowledgements from all remote nodes...");
-
- unorderedCounter.Wait();
- orderedCounter.Wait();
- }
- }
-
- Console.WriteLine();
- Console.WriteLine(">>> Example finished, press any key to exit ...");
- Console.ReadKey();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Misc/LifecycleExample.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Misc/LifecycleExample.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Misc/LifecycleExample.cs
deleted file mode 100644
index 2d319e8..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Misc/LifecycleExample.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using Apache.Ignite.Core;
-using Apache.Ignite.Core.Lifecycle;
-using Apache.Ignite.Core.Resource;
-
-namespace Apache.Ignite.Examples.Misc
-{
- /// <summary>
- /// This example shows how to provide your own <see cref="ILifecycleBean"/> implementation
- /// to be able to hook into Apache lifecycle. Example bean will output occurred lifecycle
- /// events to the console.
- /// <para />
- /// 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) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties ->
- /// Application -> Startup object);
- /// 3) Start example (F5 or Ctrl+F5).
- /// </summary>
- public class LifecycleExample
- {
- /// <summary>
- /// Runs the example.
- /// </summary>
- [STAThread]
- public static void Main()
- {
- Console.WriteLine();
- Console.WriteLine(">>> Lifecycle example started.");
-
- // Create new configuration.
- var lifecycleExampleBean = new LifecycleExampleBean();
-
- var cfg = new IgniteConfiguration
- {
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
- JvmOptions = new List<string> { "-Xms512m", "-Xmx1024m" },
- LifecycleBeans = new List<ILifecycleBean> { lifecycleExampleBean }
- };
-
- // Provide lifecycle bean to configuration.
- using (Ignition.Start(cfg))
- {
- // Make sure that lifecycle bean was notified about Ignite startup.
- Console.WriteLine();
- Console.WriteLine(">>> Started (should be true): " + lifecycleExampleBean.Started);
- }
-
- // Make sure that lifecycle bean was notified about Ignite stop.
- Console.WriteLine();
- Console.WriteLine(">>> Started (should be false): " + lifecycleExampleBean.Started);
-
- Console.WriteLine();
- Console.WriteLine(">>> Example finished, press any key to exit ...");
- Console.ReadKey();
- }
-
- /// <summary>
- /// Sample lifecycle bean implementation.
- /// </summary>
- private class LifecycleExampleBean : ILifecycleBean
- {
- /** Auto-injected Ignite instance. */
- [InstanceResource]
-#pragma warning disable 649
- private IIgnite _ignite;
-#pragma warning restore 649
-
- /** <inheritDoc /> */
- public void OnLifecycleEvent(LifecycleEventType evt)
- {
- Console.WriteLine();
- Console.WriteLine(">>> Ignite lifecycle event occurred: " + evt);
- Console.WriteLine(">>> Ignite name: " + (_ignite != null ? _ignite.Name : "not available"));
-
- if (evt == LifecycleEventType.AfterNodeStart)
- Started = true;
- else if (evt == LifecycleEventType.AfterNodeStop)
- Started = false;
- }
-
- /// <summary>
- /// Started flag.
- /// </summary>
- public bool Started
- {
- get;
- private set;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Properties/AssemblyInfo.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
deleted file mode 100644
index 555a35f..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.
- */
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Apache Ignite Examples")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache Ignite")]
-[assembly: AssemblyCopyright("Copyright © 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("41a0cb95-3435-4c78-b867-900b28e2c9ee")]
-
-[assembly: AssemblyVersion("1.5.0")]
-[assembly: AssemblyFileVersion("1.5.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/IMapService.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/IMapService.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/IMapService.cs
deleted file mode 100644
index 7253a0b..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/IMapService.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-using Apache.Ignite.ExamplesDll.Services;
-
-namespace Apache.Ignite.Examples.Services
-{
- /// <summary>
- /// Interface for service proxy interaction.
- /// Actual service class (<see cref="MapService{TK,TV}"/>) does not have to implement this interface.
- /// Target method/property will be searched by signature (name, arguments).
- /// </summary>
- public interface IMapService<TK, TV>
- {
- /// <summary>
- /// Puts an entry to the map.
- /// </summary>
- /// <param name="key">The key.</param>
- /// <param name="value">The value.</param>
- void Put(TK key, TV value);
-
- /// <summary>
- /// Gets an entry from the map.
- /// </summary>
- /// <param name="key">The key.</param>
- /// <returns>Entry value.</returns>
- TV Get(TK key);
-
- /// <summary>
- /// Clears the map.
- /// </summary>
- void Clear();
-
- /// <summary>
- /// Gets the size of the map.
- /// </summary>
- /// <value>
- /// The size.
- /// </value>
- int Size { get; }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/ServicesExample.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/ServicesExample.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/ServicesExample.cs
deleted file mode 100644
index 6d0ddd0..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.Examples/Services/ServicesExample.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using Apache.Ignite.Core;
-using Apache.Ignite.ExamplesDll.Services;
-
-namespace Apache.Ignite.Examples.Services
-{
- /// <summary>
- /// Example demonstrating Ignite services.
- /// <para />
- /// 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) Set this class as startup object (Apache.Ignite.Examples project -> right-click -> Properties ->
- /// Application -> Startup object);
- /// 3) Start example (F5 or Ctrl+F5).
- /// <para />
- /// This example can be run with standalone Apache Ignite .Net node:
- /// 1) Run %IGNITE_HOME%/platforms/dotnet/Apache.Ignite/bin/${Platform]/${Configuration}/Apache.Ignite.exe:
- /// Apache.Ignite.exe -IgniteHome="%IGNITE_HOME%" -springConfigUrl=platforms\dotnet\examples\config\example-cache.xml -assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
- /// 2) Start example.
- /// </summary>
- public class ServicesExample
- {
- /// <summary>
- /// Runs the example.
- /// </summary>
- [STAThread]
- public static void Main()
- {
- var cfg = new IgniteConfiguration
- {
- SpringConfigUrl = @"platforms\dotnet\examples\config\example-compute.xml",
- JvmOptions = new List<string> {"-Xms512m", "-Xmx1024m"}
- };
-
- using (var ignite = Ignition.Start(cfg))
- {
- Console.WriteLine(">>> Services example started.");
- Console.WriteLine();
-
- // Deploy a service
- var svc = new MapService<int, string>();
- Console.WriteLine(">>> Deploying service to all nodes...");
- ignite.GetServices().DeployNodeSingleton("service", svc);
-
- // Get a sticky service proxy so that we will always be contacting the same remote node.
- var prx = ignite.GetServices().GetServiceProxy<IMapService<int, string>>("service", true);
-
- for (var i = 0; i < 10; i++)
- prx.Put(i, i.ToString());
-
- var mapSize = prx.Size;
-
- Console.WriteLine(">>> Map service size: " + mapSize);
-
- ignite.GetServices().CancelAll();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
deleted file mode 100644
index cb2ff6f..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csproj
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{DFB08363-202E-412D-8812-349EF10A8702}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Ignite.ExamplesDll</RootNamespace>
- <AssemblyName>Apache.Ignite.ExamplesDll</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <PlatformTarget>x64</PlatformTarget>
- <OutputPath>bin\x64\Debug\</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <PlatformTarget>x64</PlatformTarget>
- <OutputPath>bin\x64\Release\</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x86\Debug\</OutputPath>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
- <OutputPath>bin\x86\Release\</OutputPath>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Compute\AverageSalaryJob.cs" />
- <Compile Include="Compute\AverageSalaryTask.cs" />
- <Compile Include="Compute\CharacterCountClosure.cs" />
- <Compile Include="Compute\CharacterCountReducer.cs" />
- <Compile Include="Datagrid\EmployeeStorePredicate.cs" />
- <Compile Include="Datagrid\ContinuousQueryFilter.cs" />
- <Compile Include="Datagrid\EmployeeStore.cs" />
- <Compile Include="Events\LocalListener.cs" />
- <Compile Include="Events\RemoteFilter.cs" />
- <Compile Include="Messaging\LocalListener.cs" />
- <Compile Include="Messaging\RemoteOrderedListener.cs" />
- <Compile Include="Messaging\RemoteUnorderedListener.cs" />
- <Compile Include="Messaging\Topic.cs" />
- <Compile Include="Portable\Account.cs" />
- <Compile Include="Portable\Address.cs" />
- <Compile Include="Portable\Employee.cs" />
- <Compile Include="Portable\EmployeeKey.cs" />
- <Compile Include="Portable\Organization.cs" />
- <Compile Include="Portable\OrganizationType.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Services\MapService.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\Apache.Ignite.Core\Apache.Ignite.Core.csproj">
- <Project>{4CD2F726-7E2B-46C4-A5BA-057BB82EECB6}</Project>
- <Name>Apache.Ignite.Core</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csprojrel
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csprojrel b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csprojrel
deleted file mode 100644
index fa6b71c..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Apache.Ignite.ExamplesDll.csprojrel
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{DFB08363-202E-412D-8812-349EF10A8702}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Ignite.ExamplesDll</RootNamespace>
- <AssemblyName>Apache.Ignite.ExamplesDll</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
- <PlatformTarget>x64</PlatformTarget>
- <OutputPath>bin\x64\Debug\</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
- <PlatformTarget>x64</PlatformTarget>
- <OutputPath>bin\x64\Release\</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x86\Debug\</OutputPath>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
- <OutputPath>bin\x86\Release\</OutputPath>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Ignite.Core">
- <HintPath>..\..\Apache.Ignite\bin\$(Platform)\$(Configuration)\Apache.Ignite.Core.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Compute\AverageSalaryJob.cs" />
- <Compile Include="Compute\AverageSalaryTask.cs" />
- <Compile Include="Compute\CharacterCountClosure.cs" />
- <Compile Include="Compute\CharacterCountReducer.cs" />
- <Compile Include="Datagrid\EmployeeStorePredicate.cs" />
- <Compile Include="Datagrid\ContinuousQueryFilter.cs" />
- <Compile Include="Datagrid\EmployeeStore.cs" />
- <Compile Include="Events\LocalListener.cs" />
- <Compile Include="Events\RemoteFilter.cs" />
- <Compile Include="Messaging\LocalListener.cs" />
- <Compile Include="Messaging\RemoteOrderedListener.cs" />
- <Compile Include="Messaging\RemoteUnorderedListener.cs" />
- <Compile Include="Messaging\Topic.cs" />
- <Compile Include="Portable\Account.cs" />
- <Compile Include="Portable\Address.cs" />
- <Compile Include="Portable\Employee.cs" />
- <Compile Include="Portable\EmployeeKey.cs" />
- <Compile Include="Portable\Organization.cs" />
- <Compile Include="Portable\OrganizationType.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Services\MapService.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryJob.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryJob.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryJob.cs
deleted file mode 100644
index e4713d4..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryJob.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using Apache.Ignite.Core.Compute;
-using Apache.Ignite.ExamplesDll.Portable;
-
-namespace Apache.Ignite.ExamplesDll.Compute
-{
- /// <summary>
- /// Average salary job.
- /// </summary>
- [Serializable]
- public class AverageSalaryJob : ComputeJobAdapter<Tuple<long, int>>
- {
- /// <summary> Employees. </summary>
- private readonly ICollection<Employee> _employees = new List<Employee>();
-
- /// <summary>
- /// Adds employee.
- /// </summary>
- /// <param name="employee">Employee.</param>
- public void Add(Employee employee)
- {
- _employees.Add(employee);
- }
-
- /// <summary>
- /// Execute the job.
- /// </summary>
- /// <returns>Job result: tuple with total salary in the first item and employees count in the second.</returns>
- override public Tuple<long, int> Execute()
- {
- long sum = 0;
- int count = 0;
-
- Console.WriteLine();
- Console.WriteLine(">>> Executing salary job for " + _employees.Count + " employee(s) ...");
- Console.WriteLine();
-
- foreach (Employee emp in _employees)
- {
- sum += emp.Salary;
- count++;
- }
-
- return new Tuple<long, int>(sum, count);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
deleted file mode 100644
index f8acb01..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/AverageSalaryTask.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Apache.Ignite.Core.Compute;
-using Apache.Ignite.ExamplesDll.Portable;
-
-namespace Apache.Ignite.ExamplesDll.Compute
-{
- /// <summary>
- /// Average salary task.
- /// </summary>
- public class AverageSalaryTask : ComputeTaskSplitAdapter<ICollection<Employee>, Tuple<long, int>, long>
- {
- /// <summary>
- /// Split the task distributing employees between several jobs.
- /// </summary>
- /// <param name="gridSize">Number of available grid nodes.</param>
- /// <param name="arg">Task execution argument.</param>
- protected override ICollection<IComputeJob<Tuple<long, int>>> Split(int gridSize, ICollection<Employee> arg)
- {
- ICollection<Employee> employees = arg;
-
- var jobs = new List<IComputeJob<Tuple<long, int>>>(gridSize);
-
- int count = 0;
-
- foreach (Employee employee in employees)
- {
- int idx = count++ % gridSize;
-
- AverageSalaryJob job;
-
- if (idx >= jobs.Count)
- {
- job = new AverageSalaryJob();
-
- jobs.Add(job);
- }
- else
- job = (AverageSalaryJob) jobs[idx];
-
- job.Add(employee);
- }
-
- return jobs;
- }
-
- /// <summary>
- /// Calculate average salary after all jobs are finished.
- /// </summary>
- /// <param name="results">Job results.</param>
- /// <returns>Average salary.</returns>
- public override long Reduce(IList<IComputeJobResult<Tuple<long, int>>> results)
- {
- long sum = 0;
- int count = 0;
-
- foreach (var t in results.Select(result => result.Data()))
- {
- sum += t.Item1;
- count += t.Item2;
- }
-
- return sum / count;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountClosure.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountClosure.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountClosure.cs
deleted file mode 100644
index 2823221..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountClosure.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core.Compute;
-
-namespace Apache.Ignite.ExamplesDll.Compute
-{
- /// <summary>
- /// Closure counting characters in a string.
- /// </summary>
- [Serializable]
- public class CharacterCountClosure : IComputeFunc<string, int>
- {
- /// <summary>
- /// Calculate character count of the given word.
- /// </summary>
- /// <param name="arg">Word.</param>
- /// <returns>Character count.</returns>
- public int Invoke(string arg)
- {
- int len = arg.Length;
-
- Console.WriteLine("Character count in word \"" + arg + "\": " + len);
-
- return len;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountReducer.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountReducer.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountReducer.cs
deleted file mode 100644
index 6825046..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Compute/CharacterCountReducer.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-
-using Apache.Ignite.Core.Compute;
-
-namespace Apache.Ignite.ExamplesDll.Compute
-{
- /// <summary>
- /// Character count reducer which collects individual string lengths and aggregate them.
- /// </summary>
- public class CharacterCountReducer : IComputeReducer<int, int>
- {
- /// <summary> Total length. </summary>
- private int _length;
-
- /// <summary>
- /// Collect character counts of distinct words.
- /// </summary>
- /// <param name="res">Character count of a distinct word.</param>
- /// <returns><c>True</c> to continue collecting results until all closures are finished.</returns>
- public bool Collect(int res)
- {
- _length += res;
-
- return true;
- }
-
- /// <summary>
- /// Reduce all collected results.
- /// </summary>
- /// <returns>Total character count.</returns>
- public int Reduce()
- {
- return _length;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/ContinuousQueryFilter.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/ContinuousQueryFilter.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/ContinuousQueryFilter.cs
deleted file mode 100644
index 8c05f42..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/ContinuousQueryFilter.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core.Cache.Event;
-
-namespace Apache.Ignite.ExamplesDll.Datagrid
-{
- /// <summary>
- /// Filter for continuous query example.
- /// </summary>
- [Serializable]
- public class ContinuousQueryFilter : ICacheEntryEventFilter<int, string>
- {
- /// <summary> Threshold. </summary>
- private readonly int _threshold;
-
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="threshold">Threshold.</param>
- public ContinuousQueryFilter(int threshold)
- {
- _threshold = threshold;
- }
-
- /// <summary>
- /// Evaluates cache entry event.
- /// </summary>
- /// <param name="evt">Event.</param>
- public bool Evaluate(ICacheEntryEvent<int, string> evt)
- {
- return evt.Key >= _threshold;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStore.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStore.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStore.cs
deleted file mode 100644
index 742b048..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStore.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using Apache.Ignite.Core.Cache;
-using Apache.Ignite.Core.Cache.Store;
-using Apache.Ignite.ExamplesDll.Portable;
-
-namespace Apache.Ignite.ExamplesDll.Datagrid
-{
- /// <summary>
- /// Example cache store implementation.
- /// </summary>
- public class EmployeeStore : CacheStoreAdapter
- {
- /// <summary>
- /// Dictionary representing the store.
- /// </summary>
- private readonly ConcurrentDictionary<object, object> _db = new ConcurrentDictionary<object, object>(
- new List<KeyValuePair<object, object>>
- {
- new KeyValuePair<object, object>(1, new Employee(
- "Allison Mathis",
- 25300,
- new Address("2702 Freedom Lane, San Francisco, CA", 94109),
- new List<string> {"Development"}
- )),
-
- new KeyValuePair<object, object>(2, new Employee(
- "Breana Robbin",
- 6500,
- new Address("3960 Sundown Lane, Austin, TX", 78130),
- new List<string> {"Sales"}
- ))
- });
-
- /// <summary>
- /// Loads all values from underlying persistent storage.
- /// This method gets called as a result of <see cref="ICache{TK,TV}.LoadCache"/> call.
- /// </summary>
- /// <param name="act">Action that loads a cache entry.</param>
- /// <param name="args">Optional arguments.</param>
- public override void LoadCache(Action<object, object> act, params object[] args)
- {
- // Iterate over whole underlying store and call act on each entry to load it into the cache.
- foreach (var entry in _db)
- act(entry.Key, entry.Value);
- }
-
- /// <summary>
- /// Loads multiple objects from the cache store.
- /// This method gets called as a result of <see cref="ICache{K,V}.GetAll"/> call.
- /// </summary>
- /// <param name="keys">Keys to load.</param>
- /// <returns>
- /// A map of key, values to be stored in the cache.
- /// </returns>
- public override IDictionary LoadAll(ICollection keys)
- {
- var result = new Dictionary<object, object>();
-
- foreach (var key in keys)
- result[key] = Load(key);
-
- return result;
- }
-
- /// <summary>
- /// Loads an object from the cache store.
- /// This method gets called as a result of <see cref="ICache{K,V}.Get"/> call.
- /// </summary>
- /// <param name="key">Key to load.</param>
- /// <returns>Loaded value</returns>
- public override object Load(object key)
- {
- object val;
-
- _db.TryGetValue(key, out val);
-
- return val;
- }
-
- /// <summary>
- /// Write key-value pair to store.
- /// </summary>
- /// <param name="key">Key to write.</param>
- /// <param name="val">Value to write.</param>
- public override void Write(object key, object val)
- {
- _db[key] = val;
- }
-
- /// <summary>
- /// Delete cache entry form store.
- /// </summary>
- /// <param name="key">Key to delete.</param>
- public override void Delete(object key)
- {
- object val;
-
- _db.TryRemove(key, out val);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStorePredicate.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStorePredicate.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStorePredicate.cs
deleted file mode 100644
index a585e5e..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Datagrid/EmployeeStorePredicate.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core.Cache;
-using Apache.Ignite.ExamplesDll.Portable;
-
-namespace Apache.Ignite.ExamplesDll.Datagrid
-{
- /// <summary>
- /// Example cache entry predicate.
- /// </summary>
- [Serializable]
- public class EmployeeStorePredicate : ICacheEntryFilter<int, Employee>
- {
- /// <summary>
- /// Returns a value indicating whether provided cache entry satisfies this predicate.
- /// </summary>
- /// <param name="entry">Cache entry.</param>
- /// <returns>Value indicating whether provided cache entry satisfies this predicate.</returns>
- public bool Invoke(ICacheEntry<int, Employee> entry)
- {
- return entry.Key == 1;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/LocalListener.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/LocalListener.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/LocalListener.cs
deleted file mode 100644
index 8a28355..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/LocalListener.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Threading;
-using Apache.Ignite.Core.Events;
-
-namespace Apache.Ignite.ExamplesDll.Events
-{
- /// <summary>
- /// Local event listener.
- /// </summary>
- public class LocalListener : IEventFilter<IEvent>
- {
- /** Сount of received events. */
- private int _eventsReceived;
-
- /// <summary>
- /// Gets the count of received events.
- /// </summary>
- public int EventsReceived
- {
- get { return _eventsReceived; }
- }
-
- /// <summary>
- /// Determines whether specified event passes this filter.
- /// </summary>
- /// <param name="nodeId">Node identifier.</param>
- /// <param name="evt">Event.</param>
- /// <returns>Value indicating whether specified event passes this filter.</returns>
- public bool Invoke(Guid nodeId, IEvent evt)
- {
- Interlocked.Increment(ref _eventsReceived);
-
- Console.WriteLine("Local listener received an event [evt={0}]", evt.Name);
-
- return true;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/RemoteFilter.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/RemoteFilter.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/RemoteFilter.cs
deleted file mode 100644
index db3204a..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Events/RemoteFilter.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core.Events;
-
-namespace Apache.Ignite.ExamplesDll.Events
-{
- /// <summary>
- /// Remote event filter.
- /// </summary>
- [Serializable]
- public class RemoteFilter : IEventFilter<IEvent>
- {
- /// <summary>
- /// Determines whether specified event passes this filter.
- /// </summary>
- /// <param name="nodeId">Node identifier.</param>
- /// <param name="evt">Event.</param>
- /// <returns>Value indicating whether specified event passes this filter.</returns>
- public bool Invoke(Guid nodeId, IEvent evt)
- {
- Console.WriteLine("Remote filter received event [evt={0}]", evt.Name);
-
- return evt is JobEvent;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/LocalListener.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/LocalListener.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/LocalListener.cs
deleted file mode 100644
index 7659bb4..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/LocalListener.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Threading;
-using Apache.Ignite.Core.Messaging;
-
-namespace Apache.Ignite.ExamplesDll.Messaging
-{
- /// <summary>
- /// Local message listener which signals countdown event on each received message.
- /// </summary>
- public class LocalListener : IMessageFilter<int>
- {
- /** Countdown event. */
- private readonly CountdownEvent _countdown;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="LocalListener"/> class.
- /// </summary>
- /// <param name="countdown">The countdown event.</param>
- public LocalListener(CountdownEvent countdown)
- {
- if (countdown == null)
- throw new ArgumentNullException("countdown");
-
- _countdown = countdown;
- }
-
- /// <summary>
- /// Receives a message and returns a value
- /// indicating whether provided message and node id satisfy this predicate.
- /// Returning false will unsubscribe this listener from future notifications.
- /// </summary>
- /// <param name="nodeId">Node identifier.</param>
- /// <param name="message">Message.</param>
- /// <returns>Value indicating whether provided message and node id satisfy this predicate.</returns>
- public bool Invoke(Guid nodeId, int message)
- {
- _countdown.Signal();
-
- return !_countdown.IsSet;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteOrderedListener.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteOrderedListener.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteOrderedListener.cs
deleted file mode 100644
index 8ae5ac1..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteOrderedListener.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core;
-using Apache.Ignite.Core.Messaging;
-using Apache.Ignite.Core.Resource;
-
-namespace Apache.Ignite.ExamplesDll.Messaging
-{
- /// <summary>
- /// Listener for Ordered topic.
- /// </summary>
- [Serializable]
- public class RemoteOrderedListener : IMessageFilter<int>
- {
- /** Injected Ignite instance. */
- [InstanceResource]
-#pragma warning disable 649
- private readonly IIgnite _ignite;
-#pragma warning restore 649
-
- /// <summary>
- /// Receives a message and returns a value
- /// indicating whether provided message and node id satisfy this predicate.
- /// Returning false will unsubscribe this listener from future notifications.
- /// </summary>
- /// <param name="nodeId">Node identifier.</param>
- /// <param name="message">Message.</param>
- /// <returns>Value indicating whether provided message and node id satisfy this predicate.</returns>
- public bool Invoke(Guid nodeId, int message)
- {
- Console.WriteLine("Received ordered message [msg={0}, fromNodeId={1}]", message, nodeId);
-
- _ignite.GetCluster().ForNodeIds(nodeId).GetMessaging().Send(message, Topic.Ordered);
-
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteUnorderedListener.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteUnorderedListener.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteUnorderedListener.cs
deleted file mode 100644
index 166dbd6..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/RemoteUnorderedListener.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core;
-using Apache.Ignite.Core.Messaging;
-using Apache.Ignite.Core.Resource;
-
-namespace Apache.Ignite.ExamplesDll.Messaging
-{
- /// <summary>
- /// Listener for Unordered topic.
- /// </summary>
- [Serializable]
- public class RemoteUnorderedListener : IMessageFilter<int>
- {
- /** Injected Ignite instance. */
- [InstanceResource]
-#pragma warning disable 649
- private readonly IIgnite _ignite;
-#pragma warning restore 649
-
- /// <summary>
- /// Receives a message and returns a value
- /// indicating whether provided message and node id satisfy this predicate.
- /// Returning false will unsubscribe this listener from future notifications.
- /// </summary>
- /// <param name="nodeId">Node identifier.</param>
- /// <param name="message">Message.</param>
- /// <returns>Value indicating whether provided message and node id satisfy this predicate.</returns>
- public bool Invoke(Guid nodeId, int message)
- {
- Console.WriteLine("Received unordered message [msg={0}, fromNodeId={1}]", message, nodeId);
-
- _ignite.GetCluster().ForNodeIds(nodeId).GetMessaging().Send(message, Topic.Unordered);
-
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/Topic.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/Topic.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/Topic.cs
deleted file mode 100644
index bda0bfe..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Messaging/Topic.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.Messaging
-{
- /// <summary>
- /// Message topics.
- /// </summary>
- public static class Topic
- {
- public const int Ordered = 1;
- public const int Unordered = 2;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Account.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Account.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Account.cs
deleted file mode 100644
index 8e247e3..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Account.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Account object. Used in transaction example.
- /// </summary>
- [Serializable]
- public class Account
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="id">Account ID.</param>
- /// <param name="balance">Account balance.</param>
- public Account(int id, decimal balance)
- {
- Id = id;
- Balance = balance;
- }
-
- /// <summary>
- /// Account ID.
- /// </summary>
- public int Id { get; set; }
-
- /// <summary>
- /// Account balance.
- /// </summary>
- public decimal Balance { get; set; }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- override public String ToString()
- {
- return string.Format("{0} [id={1}, balance={2}]", typeof(Account).Name, Id, Balance);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Address.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Address.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Address.cs
deleted file mode 100644
index ca069cb..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Address.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core.Portable;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Address.
- /// </summary>
- [Serializable]
- public class Address : IPortableMarshalAware
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="street">Street.</param>
- /// <param name="zip">ZIP code.</param>
- public Address(string street, int zip)
- {
- Street = street;
- Zip = zip;
- }
-
- /// <summary>
- /// Street.
- /// </summary>
- public string Street { get; set; }
-
- /// <summary>
- /// ZIP code.
- /// </summary>
- public int Zip { get; set; }
-
- /// <summary>
- /// Writes this object to the given writer.
- /// </summary>
- /// <param name="writer">Writer.</param>
- public void WritePortable(IPortableWriter writer)
- {
- writer.WriteString("street", Street);
- writer.WriteInt("zip", Zip);
- }
-
- /// <summary>
- /// Reads this object from the given reader.
- /// </summary>
- /// <param name="reader">Reader.</param>
- public void ReadPortable(IPortableReader reader)
- {
- Street = reader.ReadString("street");
- Zip = reader.ReadInt("zip");
- }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- override public string ToString()
- {
- return string.Format("{0} [street={1}, zip={2}]", typeof(Address).Name, Street, Zip);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Employee.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Employee.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Employee.cs
deleted file mode 100644
index 7f4388d..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Employee.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Employee.
- /// </summary>
- [Serializable]
- public class Employee
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="name">Name.</param>
- /// <param name="salary">Salary.</param>
- /// <param name="address">Address.</param>
- /// <param name="departments">Departments.</param>
- public Employee(string name, long salary, Address address, ICollection<string> departments)
- {
- Name = name;
- Salary = salary;
- Address = address;
- Departments = departments;
- }
-
- /// <summary>
- /// Name.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Salary.
- /// </summary>
- public long Salary { get; set; }
-
- /// <summary>
- /// Address.
- /// </summary>
- public Address Address { get; set; }
-
- /// <summary>
- /// Departments.
- /// </summary>
- public ICollection<string> Departments { get; set; }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- override public string ToString()
- {
- return string.Format("{0} [name={1}, salary={2}, address={3}, departments={4}]", typeof(Employee).Name,
- Name, Salary, Address, CollectionToString(Departments));
- }
-
- /// <summary>
- /// Get string representation of collection.
- /// </summary>
- /// <returns></returns>
- private static string CollectionToString<T>(ICollection<T> col)
- {
- if (col == null)
- return "null";
-
- var elements = col.Any()
- ? col.Select(x => x.ToString()).Aggregate((x, y) => x + ", " + y)
- : string.Empty;
-
- return string.Format("[{0}]", elements);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
deleted file mode 100644
index 2267154..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Employee key. Used in query example to co-locate employees with their organizations.
- /// </summary>
- [Serializable]
- public class EmployeeKey
- {
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="id">ID.</param>
- /// <param name="orgId">Organization ID.</param>
- public EmployeeKey(int id, int orgId)
- {
- Id = id;
- OrganizationId = orgId;
- }
-
- /// <summary>
- /// ID.
- /// </summary>
- public int Id { get; private set; }
-
- /// <summary>
- /// Organization ID.
- /// </summary>
- public int OrganizationId { get; private set; }
-
- /// <summary>
- /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
- /// </summary>
- /// <returns>
- /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
- /// </returns>
- /// <param name="obj">The object to compare with the current object. </param><filterpriority>2</filterpriority>
- public override bool Equals(object obj)
- {
- EmployeeKey other = obj as EmployeeKey;
-
- return other != null && Id == other.Id && OrganizationId == other.OrganizationId;
- }
-
- /// <summary>
- /// Serves as a hash function for a particular type.
- /// </summary>
- /// <returns>
- /// A hash code for the current <see cref="T:System.Object"/>.
- /// </returns>
- /// <filterpriority>2</filterpriority>
- public override int GetHashCode()
- {
- return 31 * Id + OrganizationId;
- }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- public override string ToString()
- {
- return string.Format("{0} [id={1}, organizationId={2}]", typeof (EmployeeKey).Name, Id, OrganizationId);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Organization.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Organization.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Organization.cs
deleted file mode 100644
index e23c3c1..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/Organization.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Organization.
- /// </summary>
- [Serializable]
- public class Organization
- {
- /// <summary>
- /// Default constructor.
- /// </summary>
- public Organization()
- {
- // No-op.
- }
-
- /// <summary>
- /// Constructor.
- /// </summary>
- /// <param name="name">Name.</param>
- /// <param name="address">Address.</param>
- /// <param name="type">Type.</param>
- /// <param name="lastUpdated">Last update time.</param>
- public Organization(string name, Address address, OrganizationType type, DateTime lastUpdated)
- {
- Name = name;
- Address = address;
- Type = type;
- LastUpdated = lastUpdated;
- }
-
- /// <summary>
- /// Name.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Address.
- /// </summary>
- public Address Address { get; set; }
-
- /// <summary>
- /// Type.
- /// </summary>
- public OrganizationType Type { get; set; }
-
- /// <summary>
- /// Last update time.
- /// </summary>
- public DateTime LastUpdated { get; set; }
-
- /// <summary>
- /// Returns a string that represents the current object.
- /// </summary>
- /// <returns>
- /// A string that represents the current object.
- /// </returns>
- /// <filterpriority>2</filterpriority>
- public override string ToString()
- {
- return string.Format("{0} [name={1}, address={2}, type={3}, lastUpdated={4}]", typeof (Organization).Name,
- Name, Address, Type, LastUpdated);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
deleted file mode 100644
index 198edb1..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-
-namespace Apache.Ignite.ExamplesDll.Portable
-{
- /// <summary>
- /// Organization type.
- /// </summary>
- [Serializable]
- public enum OrganizationType
- {
- /// <summary>
- /// Non-profit organization.
- /// </summary>
- NonProfit,
-
- /// <summary>
- /// Private organization.
- /// </summary>
- Private,
-
- /// <summary>
- /// Government organization.
- /// </summary>
- Government
- }
-}
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
deleted file mode 100644
index f149d64..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.
- */
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("Apache Ignite Examples Dll")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache Ignite")]
-[assembly: AssemblyCopyright("Copyright © 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
-
-[assembly: AssemblyVersion("1.5.0")]
-[assembly: AssemblyFileVersion("1.5.0")]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Services/MapService.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Services/MapService.cs b/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Services/MapService.cs
deleted file mode 100644
index d577ff7..0000000
--- a/modules/platform/dotnet/Examples2/Apache.Ignite.ExamplesDll/Services/MapService.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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.
- */
-
-using System;
-using Apache.Ignite.Core;
-using Apache.Ignite.Core.Cache;
-using Apache.Ignite.Core.Resource;
-using Apache.Ignite.Core.Services;
-
-namespace Apache.Ignite.ExamplesDll.Services
-{
- /// <summary>
- /// Service implementation.
- /// </summary>
- [Serializable]
- public class MapService<TK, TV> : IService
- {
- /** Injected Ignite instance. */
-#pragma warning disable 649
- [InstanceResource] private readonly IIgnite _ignite;
-#pragma warning restore 649
-
- /** Cache. */
- private ICache<TK, TV> _cache;
-
- /// <summary>
- /// Initializes this instance before execution.
- /// </summary>
- /// <param name="context">Service execution context.</param>
- public void Init(IServiceContext context)
- {
- // Create a new cache for every service deployment.
- // Note that we use service name as cache name, which allows
- // for each service deployment to use its own isolated cache.
- _cache = _ignite.GetOrCreateCache<TK, TV>("MapService_" + context.Name);
-
- Console.WriteLine("Service initialized: " + context.Name);
- }
-
- /// <summary>
- /// Starts execution of this service. This method is automatically invoked whenever an instance of the service
- /// is deployed on an Ignite node. Note that service is considered deployed even after it exits the Execute
- /// method and can be cancelled (or undeployed) only by calling any of the Cancel methods on
- /// <see cref="IServices"/> API. Also note that service is not required to exit from Execute method until
- /// Cancel method was called.
- /// </summary>
- /// <param name="context">Service execution context.</param>
- public void Execute(IServiceContext context)
- {
- Console.WriteLine("Service started: " + context.Name);
- }
-
- /// <summary>
- /// Cancels this instance.
- /// <para/>
- /// Note that Ignite cannot guarantee that the service exits from <see cref="IService.Execute"/>
- /// method whenever <see cref="IService.Cancel"/> is called. It is up to the user to
- /// make sure that the service code properly reacts to cancellations.
- /// </summary>
- /// <param name="context">Service execution context.</param>
- public void Cancel(IServiceContext context)
- {
- Console.WriteLine("Service cancelled: " + context.Name);
- }
-
- /// <summary>
- /// Puts an entry to the map.
- /// </summary>
- /// <param name="key">The key.</param>
- /// <param name="value">The value.</param>
- public void Put(TK key, TV value)
- {
- _cache.Put(key, value);
- }
-
- /// <summary>
- /// Gets an entry from the map.
- /// </summary>
- /// <param name="key">The key.</param>
- /// <returns>Entry value.</returns>
- public TV Get(TK key)
- {
- return _cache.Get(key);
- }
-
- /// <summary>
- /// Clears the map.
- /// </summary>
- public void Clear()
- {
- _cache.Clear();
- }
-
- /// <summary>
- /// Gets the size of the map.
- /// </summary>
- /// <value>
- /// The size.
- /// </value>
- public int Size
- {
- get { return _cache.GetSize(); }
- }
- }
-}