Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBFDA200D2B for ; Thu, 19 Oct 2017 06:35:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA614160BEB; Thu, 19 Oct 2017 04:35:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8E5C160BEA for ; Thu, 19 Oct 2017 06:35:15 +0200 (CEST) Received: (qmail 31050 invoked by uid 500); 19 Oct 2017 04:35:15 -0000 Mailing-List: contact commits-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list commits@geode.apache.org Received: (qmail 31040 invoked by uid 99); 19 Oct 2017 04:35:14 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 04:35:14 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C94D081CE4; Thu, 19 Oct 2017 04:35:13 +0000 (UTC) Date: Thu, 19 Oct 2017 04:35:13 +0000 To: "commits@geode.apache.org" Subject: [geode-examples] branch master updated: Adds initial example for Geode Native .NET client. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <150838771336.14659.7713614196819824964@gitbox.apache.org> From: jbarrett@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: geode-examples X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 98ae39bddff7f9ed847b33861c1bc194240b270e X-Git-Newrev: 821a2fd3886eb20c8a74bef30b88715d48f69f44 X-Git-Rev: 821a2fd3886eb20c8a74bef30b88715d48f69f44 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Thu, 19 Oct 2017 04:35:17 -0000 This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/geode-examples.git The following commit(s) were added to refs/heads/master by this push: new 821a2fd Adds initial example for Geode Native .NET client. 821a2fd is described below commit 821a2fd3886eb20c8a74bef30b88715d48f69f44 Author: Jacob Barrett AuthorDate: Thu Oct 19 04:32:47 2017 +0000 Adds initial example for Geode Native .NET client. --- .gitignore | 5 ++ README.md | 4 ++ .../Apache.Geode.Examples.Cache.csproj | 77 ++++++++++++++++++++++ .../dotnet/Apache.Geode.Examples.Cache/Program.cs | 48 ++++++++++++++ .../dotnet/Apache.Geode.Examples.Cache/README.md | 14 ++++ native/dotnet/Apache.Geode.Examples.sln | 21 ++++++ native/dotnet/README.md | 13 ++++ 7 files changed, 182 insertions(+) diff --git a/.gitignore b/.gitignore index bc00815..b4d66f3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,8 @@ server2 *.dat *.rej *.orig + +/native/dotnet/*/bin +/native/dotnet/*/obj +/native/dotnet/.vs + diff --git a/README.md b/README.md index 1894591..77d492f 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,10 @@ tutorial. * Resource manager * PDX Advanced +### Native +* C++ +* [.NET](native/dotnet/README.md) + ### Use cases, integrations and external examples This section has self-contained little projects that illustrate a use case or diff --git a/native/dotnet/Apache.Geode.Examples.Cache/Apache.Geode.Examples.Cache.csproj b/native/dotnet/Apache.Geode.Examples.Cache/Apache.Geode.Examples.Cache.csproj new file mode 100644 index 0000000..b108c40 --- /dev/null +++ b/native/dotnet/Apache.Geode.Examples.Cache/Apache.Geode.Examples.Cache.csproj @@ -0,0 +1,77 @@ + + + + + + Debug + AnyCPU + {15ACFB5B-0D2C-4C38-9236-7AF01874A84F} + Exe + Properties + Apache.Geode.Examples.Cache + Apache.Geode.Examples.Cache + v4.5.2 + 512 + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + + Y:\build64\clicache\src\Debug\Apache.Geode.dll + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/native/dotnet/Apache.Geode.Examples.Cache/Program.cs b/native/dotnet/Apache.Geode.Examples.Cache/Program.cs new file mode 100644 index 0000000..52aa3a8 --- /dev/null +++ b/native/dotnet/Apache.Geode.Examples.Cache/Program.cs @@ -0,0 +1,48 @@ +/* + * 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.Geode.Client; + +namespace Apache.Geode.Examples.Cache +{ + class Program + { + static void Main(string[] args) + { + var cacheFactory = CacheFactory.CreateCacheFactory(); + var cache = cacheFactory.Create(); + + var poolFactory = cache.GetPoolFactory() + .AddLocator("localhost", 10334); + poolFactory.Create("pool", cache); + + var regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY) + .SetPoolName("pool"); + var region = regionFactory.Create("region"); + + region["a"] = "1"; + region["b"] = "2"; + + var a = region["a"]; + var b = region["b"]; + + Console.Out.WriteLine("a = " + a); + Console.Out.WriteLine("b = " + b); + } + } +} diff --git a/native/dotnet/Apache.Geode.Examples.Cache/README.md b/native/dotnet/Apache.Geode.Examples.Cache/README.md new file mode 100644 index 0000000..167eaa4 --- /dev/null +++ b/native/dotnet/Apache.Geode.Examples.Cache/README.md @@ -0,0 +1,14 @@ +# Cache Example + +## Prerequisits +* Install [Apache Geode](https://geode.apache.org) +* Build and install [Apache Geode Native](https://github.com/apache/geode-native) + +## Running +* Start Geode Server and create region. + ``` + gfsh>start locator --name=locator + gfsh>start server --name=server + gfsh>create region --name=region --type=PARTITION + ``` +* Execute `Apache.Geode.Examples.Cache.exe`. diff --git a/native/dotnet/Apache.Geode.Examples.sln b/native/dotnet/Apache.Geode.Examples.sln new file mode 100644 index 0000000..88dc3e8 --- /dev/null +++ b/native/dotnet/Apache.Geode.Examples.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Geode.Examples.Cache", "Apache.Geode.Examples.Cache\Apache.Geode.Examples.Cache.csproj", "{15ACFB5B-0D2C-4C38-9236-7AF01874A84F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {15ACFB5B-0D2C-4C38-9236-7AF01874A84F}.Debug|x64.ActiveCfg = Debug|x64 + {15ACFB5B-0D2C-4C38-9236-7AF01874A84F}.Debug|x64.Build.0 = Debug|x64 + {15ACFB5B-0D2C-4C38-9236-7AF01874A84F}.Release|x64.ActiveCfg = Release|x64 + {15ACFB5B-0D2C-4C38-9236-7AF01874A84F}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/native/dotnet/README.md b/native/dotnet/README.md new file mode 100644 index 0000000..ef6c1dd --- /dev/null +++ b/native/dotnet/README.md @@ -0,0 +1,13 @@ +# Geode Native .NET Examples + +## Prerequisits +* Install [Apache Geode](https://geode.apache.org) +* Build and install [Apache Geode Native](https://github.com/apache/geode-native) + +## Solution Includes +* [Apache.Geode.Examples.Cache](Apache.Geode.Examples.Cache/README.md) + +## Using +1) Open `Apache.Geode.Examples.sln` in [Visual Studio 2015](https://www.visualstudio.com/) +or newer. +2) Update `Apache.Geode` reference in each project to the `Apache.Geode.dll` assembly. \ No newline at end of file -- To stop receiving notification emails like this one, please contact ['"commits@geode.apache.org" '].