GEODE-2462: Remove examples directory. This closes #5.
Project: http://git-wip-us.apache.org/repos/asf/geode-native/repo Commit: http://git-wip-us.apache.org/repos/asf/geode-native/commit/b2edccfc Tree: http://git-wip-us.apache.org/repos/asf/geode-native/tree/b2edccfc Diff: http://git-wip-us.apache.org/repos/asf/geode-native/diff/b2edccfc Branch: refs/heads/develop Commit: b2edccfcc7cf7d16e33bda462873cf02702b7093 Parents: c38580a Author: Sarge <[email protected]> Authored: Fri Feb 10 15:49:25 2017 -0800 Committer: Jacob Barrett <[email protected]> Committed: Mon Feb 13 16:55:45 2017 -0800 ---------------------------------------------------------------------- .../BenchmarkHierarchicalClient.cs | 225 --- .../BenchmarkHierarchicalClient.csproj | 103 -- .../BenchmarkHierarchicalClient.xml | 34 - .../Properties/AssemblyInfo.cs | 49 - .../BenchmarkHierarchicalClient/README.html | 165 -- examples/clicache/CacheRunner/CacheRunner.cs | 708 ------- .../clicache/CacheRunner/CacheRunner.csproj | 145 -- .../CacheRunner/CacheRunner.csproj.user | 22 - examples/clicache/CacheRunner/Callbacks.cs | 94 - examples/clicache/CacheRunner/ComplexNumber.cs | 215 --- examples/clicache/CacheRunner/ExampleObject.cs | 238 --- .../CacheRunner/Properties/AssemblyInfo.cs | 49 - examples/clicache/CacheRunner/README.html | 666 ------- examples/clicache/CqQuery/CqQuery.cs | 342 ---- examples/clicache/CqQuery/CqQuery.csproj | 113 -- examples/clicache/CqQuery/CqQuery.csproj.user | 22 - .../clicache/CqQuery/Properties/AssemblyInfo.cs | 49 - examples/clicache/CqQuery/README.html | 434 ----- .../ExecuteFunctions/ExecuteFunctions.cs | 234 --- .../ExecuteFunctions/ExecuteFunctions.csproj | 101 - .../ExecuteFunctions.csproj.user | 22 - .../ExecuteFunctions/Properties/AssemblyInfo.cs | 49 - examples/clicache/ExecuteFunctions/README.html | 437 ----- examples/clicache/HelloWorld/DocIndex.css | 1074 ----------- examples/clicache/HelloWorld/HelloWorld.cs | 108 -- examples/clicache/HelloWorld/HelloWorld.csproj | 101 - .../clicache/HelloWorld/HelloWorld.csproj.user | 21 - .../HelloWorld/Properties/AssemblyInfo.cs | 49 - examples/clicache/HelloWorld/README.html | 132 -- .../HierarchicalClient/HierarchicalClient.cs | 268 --- .../HierarchicalClient.csproj | 102 - .../HierarchicalClient/HierarchicalClient.xml | 28 - .../Properties/AssemblyInfo.cs | 49 - .../clicache/HierarchicalClient/README.html | 184 -- .../clicache/ProductBrowser/Form1.Designer.cs | 373 ---- examples/clicache/ProductBrowser/Form1.cs | 351 ---- examples/clicache/ProductBrowser/Form1.resx | 137 -- examples/clicache/ProductBrowser/Product.cs | 302 --- .../ProductBrowser/ProductBrowser.csproj | 136 -- examples/clicache/ProductBrowser/Program.cs | 37 - .../ProductBrowser/Properties/AssemblyInfo.cs | 49 - .../Properties/Resources.Designer.cs | 63 - .../ProductBrowser/Properties/Resources.resx | 134 -- .../Properties/Settings.Designer.cs | 26 - .../ProductBrowser/Properties/Settings.settings | 24 - examples/clicache/ProductBrowser/README.html | 392 ---- .../com/examples/gemfire/net/Product.java | 218 --- .../examples/gemfire/net/ProductBrowser.java | 206 --- .../defaultConfig/gemfire.properties | 21 - .../ProductBrowser/defaultConfig/product.xml | 23 - .../clicache/ProductBrowser/gemfire.properties | 21 - .../ProductBrowser/lib/productClient.jar | Bin 12113 -> 0 bytes examples/clicache/ProductBrowser/product.xml | 31 - examples/clicache/UserObjects/AccountHistory.cs | 103 -- examples/clicache/UserObjects/BankAccount.cs | 139 -- examples/clicache/UserObjects/Program.cs | 82 - .../UserObjects/Properties/AssemblyInfo.cs | 49 - .../clicache/UserObjects/UserObjects.csproj | 103 -- examples/dist/c-overview.dox | 32 - examples/dist/cacheRunner/CacheRunner.cpp | 1650 ----------------- examples/dist/cacheRunner/CacheRunner.hpp | 327 ---- examples/dist/cacheRunner/CommandReader.cpp | 331 ---- examples/dist/cacheRunner/CommandReader.hpp | 167 -- examples/dist/cacheRunner/ExampleObject.hpp | 203 -- examples/dist/cacheRunner/README.html | 1750 ------------------ examples/dist/cacheRunner/TestCacheCallback.cpp | 263 --- examples/dist/cacheRunner/TestCacheCallback.hpp | 105 -- examples/dist/cacheRunner/TestCacheListener.cpp | 172 -- examples/dist/cacheRunner/TestCacheListener.hpp | 173 -- examples/dist/cacheRunner/TestCacheLoader.cpp | 79 - examples/dist/cacheRunner/TestCacheLoader.hpp | 107 -- examples/dist/cacheRunner/TestCacheWriter.cpp | 261 --- examples/dist/cacheRunner/TestCacheWriter.hpp | 207 --- examples/dist/cacheRunner/User.hpp | 155 -- examples/dist/cacheRunner/buildit.bat | 22 - examples/dist/cacheRunner/buildit.sh | 57 - examples/dist/cacheRunner/cacherunner.xml | 47 - examples/dist/cacheRunner/cacherunner2.xml | 47 - examples/dist/cacheRunner/csQueryPortfolios.xml | 372 ---- .../dist/cacheRunner/csQueryPortfolios2.xml | 372 ---- .../dist/cacheRunner/gfecs1/cacherunner.xml | 47 - .../cacheRunner/gfecs1/csQueryPortfolios.xml | 372 ---- .../dist/cacheRunner/gfecs2/cacherunner2.xml | 47 - .../cacheRunner/gfecs2/csQueryPortfolios2.xml | 372 ---- examples/dist/cacheRunner/tcr_cache.xml | 48 - examples/dist/cacheRunner/tcr_cacheless.xml | 54 - examples/dist/cacheRunner/tcr_hacache.xml | 55 - examples/dist/cacheRunner/tcr_hacacheless.xml | 53 - examples/dist/cqQuery/CqQuery.cpp | 402 ---- examples/dist/cqQuery/README.html | 349 ---- examples/dist/cqQuery/Updater.cpp | 112 -- examples/dist/cqQuery/XMLs/clientCqQuery.xml | 32 - examples/dist/cqQuery/XMLs/serverCqQuery.xml | 109 -- examples/dist/cqQuery/buildit.bat | 23 - examples/dist/cqQuery/buildit.sh | 68 - examples/dist/cqQuery/cleanup.bat | 22 - examples/dist/cqQuery/cleanup.sh | 23 - examples/dist/cqQuery/runCqQuery.bat | 35 - examples/dist/cqQuery/runCqQuery.sh | 34 - examples/dist/cqQuery/runUpdater.bat | 35 - examples/dist/cqQuery/runUpdater.sh | 34 - examples/dist/cqQuery/startServer.bat | 47 - examples/dist/cqQuery/startServer.sh | 35 - examples/dist/cqQuery/stopServer.bat | 36 - examples/dist/cqQuery/stopServer.sh | 34 - .../dist/executeFunction/ExecuteFunctions.cpp | 304 --- .../XMLs/serverExecuteFunctions.xml | 49 - .../XMLs/serverExecuteFunctions2.xml | 49 - examples/dist/executeFunction/buildit.bat | 22 - examples/dist/executeFunction/buildit.sh | 62 - examples/dist/executeFunction/cleanup.bat | 24 - examples/dist/executeFunction/cleanup.sh | 25 - .../executeFunction/runExecuteFunctions.bat | 35 - .../dist/executeFunction/runExecuteFunctions.sh | 34 - examples/dist/executeFunction/startServer.bat | 49 - examples/dist/executeFunction/startServer.sh | 41 - examples/dist/executeFunction/stopServer.bat | 37 - examples/dist/executeFunction/stopServer.sh | 36 - examples/dist/overview.html | 31 - examples/dist/userobjects/AccountHistory.cpp | 115 -- examples/dist/userobjects/AccountHistory.hpp | 75 - examples/dist/userobjects/BankAccount.cpp | 78 - examples/dist/userobjects/BankAccount.hpp | 90 - examples/dist/userobjects/EClassIds.hpp | 33 - examples/dist/userobjects/ExampleMain.cpp | 84 - examples/dist/userobjects/README.html | 122 -- examples/dist/userobjects/buildit.bat | 22 - examples/dist/userobjects/buildit.sh | 58 - examples/unix_README.html | 57 - examples/win_README.html | 73 - 130 files changed, 20634 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.cs b/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.cs deleted file mode 100755 index 4be4cdd..0000000 --- a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.cs +++ /dev/null @@ -1,225 +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. - */ - - /* - * This example measures the time it takes for a client caching operation to - * return in a hierarchical cache configuration. - * - * While this example uses a console application, it is not a requirement. - * - * Please note that this example requires that the BenchmarkHierarchicalServer - * be running prior to execution. To start the BenchmarkHierarchicalServer - * QuickStart example, please refer to the GemFire Quickstart documentation. -//////////////////////////////////////////////////////////////////////////////*/ -using System; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; - -using Apache.Geode.Client; - -public class BenchmarkHierarchicalClient -{ - [STAThread()] - public static void Main() - { - /* Total number of benchmark samples to benchmark and the number of puts - * to make for each sample. - */ - const int cnBenchmarkedSamples = 60, - cnOperationsPerSample = 5000; - - DistributedSystem MyDistributedSystem = null; - Cache MyCache = null; - - try - { - DateTime[] BenchmarkedItemTimes = new DateTime[cnBenchmarkedSamples]; - - // Determine what the serialized overhead is. - MemoryStream SerializedStream = new MemoryStream(); - - new BinaryFormatter().Serialize(SerializedStream, new byte[0]); - - /* The payload size is done in this manner because we want a 1KB size, - * and, therefore, the overhead must be backed out of the overall length. - */ - byte[] Payload = new byte[1024 - SerializedStream.Length]; - - SerializedStream.Close(); - - DateTime StartingTime; - - Console.WriteLine("* Connecting to the distributed system and creating the cache."); - - /* Properties can be passed to GemFire through two different mechanisms: the - * Properties object as is done below or the gfcpp.properties file. The - * settings passed in a Properties object take precedence over any settings - * in a file. This way the end-user cannot bypass any required settings. - * - * Using a gfcpp.properties file can be useful when you want to change the - * behavior of certain settings without doing a new build, test, and deploy cycle. - * - * See gfcpp.properties for details on some of the other settings used in this - * project. - */ - Properties DistributedSystemProperties = new Properties(); - - DistributedSystemProperties.Insert("log-file", "C:/temp/benchmarkClient.log"); - DistributedSystemProperties.Insert("log-level", "debug"); - - // Set the name used to identify the member of the distributed system. - DistributedSystemProperties.Insert("name", "BenchmarkHierarchicalClient"); - - /* Specify the file whose contents are used to initialize the cache when it is created. - * - * An XML file isn't needed at all because everything can be specified in code--much - * as the "license-file" property is. However, it provides a convenient way - * to isolate common settings that can be updated without a build/test/deploy cycle. - */ - DistributedSystemProperties.Insert("cache-xml-file", "BenchmarkHierarchicalClient.xml"); - - /* Define where the license file is located. It is very useful to do this in - * code vs. the gemfire.properties file, because it allows you to access the - * license used by the GemFire installation (as pointed to by the GEMFIRE - * environment variable). - */ - DistributedSystemProperties.Insert("license-file", "../../gfCppLicense.zip"); - - // Connect to the GemFire distributed system. - MyDistributedSystem = DistributedSystem.Connect("BenchmarkClient", DistributedSystemProperties); - - // Create the cache. This causes the cache-xml-file to be parsed. - MyCache = CacheFactory.Create("BenchmarkClient", MyDistributedSystem); - - - // Get the example region which is a subregion of /root - Region MyExampleRegion = MyCache.GetRegion("/root/exampleRegion"); - - Console.WriteLine("{0}* Region, {1}, was opened in the cache.{2}", - Environment.NewLine, MyExampleRegion.FullPath, Environment.NewLine); - - Console.WriteLine("Please wait while the benchmark tests are performed."); - - StartingTime = System.DateTime.Now; - - // Perform benchmark until cnBenchmarkedSamples are executed - for (int nCurrentBenchmarkedItem = 0; nCurrentBenchmarkedItem < cnBenchmarkedSamples; nCurrentBenchmarkedItem++) - { - for (int nOperations = 0; nOperations < cnOperationsPerSample; nOperations++) - { - /* Perform the serialization every time to more accurately - * represent the normal behavior of an application. - * - * Optimize performance by allocating memory for 1KB. - */ - MyExampleRegion.Put("Key3", CacheableBytes.Create(Payload)); - - } - - BenchmarkedItemTimes[nCurrentBenchmarkedItem] = System.DateTime.Now; - } - - Console.WriteLine("{0}Finished benchmarking. Analyzing the results.", - Environment.NewLine); - - long nTotalOperations = cnBenchmarkedSamples * cnOperationsPerSample; - - // Calculate the total time for the benchmark. - TimeSpan BenchmarkTimeSpan = BenchmarkedItemTimes[cnBenchmarkedSamples - 1] - StartingTime; - - // Find the best sample. - TimeSpan BestSampleTime = BenchmarkedItemTimes[0] - StartingTime; - - for (int nCurrentSample = 1; nCurrentSample < BenchmarkedItemTimes.Length; nCurrentSample++) - { - // Evaluation the sample's time with the sample preceding it. - TimeSpan CurrentSampleTime = BenchmarkedItemTimes[nCurrentSample] - BenchmarkedItemTimes[nCurrentSample - 1]; - - if (CurrentSampleTime < BestSampleTime) - { - BestSampleTime = CurrentSampleTime; - } - } - - Console.WriteLine("{0}Benchmark Statistics:", Environment.NewLine); - Console.WriteLine("\tNumber of Samples: {0}", cnBenchmarkedSamples); - Console.WriteLine("\t1KB Operations/Sample: {0}", cnOperationsPerSample); - Console.WriteLine("\tTotal 1KB Operations: {0}", nTotalOperations); - Console.WriteLine("\tTotal Time: {0:N2} seconds", - BenchmarkTimeSpan.TotalSeconds); - - Console.WriteLine("{0}Benchmark Averages (Mean):", Environment.NewLine); - Console.WriteLine("\tKB/Second: {0:N2}", - nTotalOperations / BenchmarkTimeSpan.TotalSeconds); - Console.WriteLine("\tBytes/Second: {0:N2}", - (1024 * nTotalOperations) / BenchmarkTimeSpan.TotalSeconds); - Console.WriteLine("\tMilliseconds/KB: {0:N2}", - BenchmarkTimeSpan.TotalMilliseconds / nTotalOperations); - Console.WriteLine("\tNanoseconds/KB: {0}", - BenchmarkTimeSpan.Ticks / nTotalOperations); - Console.WriteLine("\tNanoseconds/Byte: {0:N2}", - BenchmarkTimeSpan.Ticks / (1024D * nTotalOperations)); - - Console.WriteLine("{0}Best Benchmark Results:", Environment.NewLine); - Console.WriteLine("\tKB/Second = {0:N2}", - cnOperationsPerSample / BestSampleTime.TotalSeconds); - Console.WriteLine("\tBytes/Second = {0:N2}", - (1024 * cnOperationsPerSample) / BestSampleTime.TotalSeconds); - Console.WriteLine("\tMilliseconds/KB = {0:N2}", - BestSampleTime.TotalMilliseconds / cnOperationsPerSample); - Console.WriteLine("\tNanoseconds/KB: {0}", - BestSampleTime.Ticks / cnOperationsPerSample); - Console.WriteLine("\tNanoseconds/Byte: {0:N2}", - BestSampleTime.Ticks / (1024D * cnOperationsPerSample)); - - // Keep the console active until <Enter> is pressed. - Console.WriteLine("{0}---[ Press <Enter> to End the Application ]---", - Environment.NewLine); - Console.ReadLine(); - } - catch (Exception ThrownException) - { - Console.Error.WriteLine(ThrownException.Message); - Console.Error.WriteLine("---[ Press <Enter> to End the Application ]---"); - Console.Error.WriteLine(ThrownException.StackTrace); - Console.ReadLine(); - } - finally - { - /* While there are not any ramifications of terminating without closing the cache - * and disconnecting from the distributed system, it is considered a best practice - * to do so. - */ - try - { - Console.WriteLine("Closing the cache and disconnecting.{0}", - Environment.NewLine); - } - catch {/* Ignore any exceptions */} - - try - { - /* Close the cache. This terminates the cache and releases all the resources. - * Generally speaking, after a cache is closed, any further method calls on - * it or region object will throw an exception. - */ - MyCache.Close(); - } - catch {/* Ignore any exceptions */} - } - } -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.csproj ---------------------------------------------------------------------- diff --git a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.csproj b/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.csproj deleted file mode 100755 index 0b0bff3..0000000 --- a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.csproj +++ /dev/null @@ -1,103 +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. ---> -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{DAF42015-6FB4-4B35-A486-46BB68CB18CA}</ProjectGuid> - <OutputType>Exe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Apache.Geode.Client.Examples</RootNamespace> - <AssemblyName>BenchmarkHierarchicalClient</AssemblyName> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\BenchmarkHierarchicalClient\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\BenchmarkHierarchicalClient\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <PlatformTarget>x86</PlatformTarget> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\BenchmarkHierarchicalClient\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\BenchmarkHierarchicalClient\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <PlatformTarget>x86</PlatformTarget> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\BenchmarkHierarchicalClient\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\BenchmarkHierarchicalClient\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <DebugType>full</DebugType> - <PlatformTarget>x64</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\BenchmarkHierarchicalClient\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\BenchmarkHierarchicalClient\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <Optimize>true</Optimize> - <DebugType>pdbonly</DebugType> - <PlatformTarget>x64</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoWarn>618</NoWarn> - </PropertyGroup> - <ItemGroup> - <ProjectReference Include="..\..\..\vs_projects\gfclicache\gfclicache.vcproj"> - <Project>{B274E3B1-6A09-4322-952B-8BDA712892CE}</Project> - <Name>gfclicache</Name> - <Aliases>global</Aliases> - </ProjectReference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="BenchmarkHierarchicalClient.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\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/geode-native/blob/b2edccfc/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.xml ---------------------------------------------------------------------- diff --git a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.xml b/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.xml deleted file mode 100644 index 64bfab2..0000000 --- a/examples/clicache/BenchmarkHierarchicalClient/BenchmarkHierarchicalClient.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.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. ---> - -<cache xmlns="http://geode.apache.org/schema/cache" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd" - version="1.0"> - <region name="root"> - <region-attributes scope="distributed-no-ack" endpoints="localhost:40404" /> - <region name="exampleRegion"> - <region-attributes - scope="distributed-no-ack" - endpoints="localhost:40404" - client-notification="true"/> - </region> - </region> -</cache> - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/BenchmarkHierarchicalClient/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/BenchmarkHierarchicalClient/Properties/AssemblyInfo.cs b/examples/clicache/BenchmarkHierarchicalClient/Properties/AssemblyInfo.cs deleted file mode 100755 index 6593e18..0000000 --- a/examples/clicache/BenchmarkHierarchicalClient/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,49 +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.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BenchmarkHierarchicalClient")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("GemStone Systems, Inc.")] -[assembly: AssemblyProduct("BenchmarkHierarchicalClient")] -[assembly: AssemblyCopyright("Copyright © GemStone Systems, Inc. 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bbbb604d-c503-4d0f-ab8a-346968dffd6a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.0.0.0")] http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/BenchmarkHierarchicalClient/README.html ---------------------------------------------------------------------- diff --git a/examples/clicache/BenchmarkHierarchicalClient/README.html b/examples/clicache/BenchmarkHierarchicalClient/README.html deleted file mode 100755 index be5a59f..0000000 --- a/examples/clicache/BenchmarkHierarchicalClient/README.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML> -<!-- - 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. ---> -<HEAD> -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> -<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> -<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 7.0/HTML Export Filter"> - -<TITLE>BenchmarkHierarchicalClient: Pivotal GemFire® Native Client Example</TITLE> - -</HEAD> -<BODY> - <IMG SRC="../../../docs/PIVOTAL_GemFire_190x81.png" BORDER="0"> - <DIV> - <h1 align="center"><a name="Top" id="Top"></a>BenchmarkHierarchicalClient</h1> - <h2 align="center"> - Pivotal GemFire® Native Client </h2> - <h2 align="center">C# Programming Example</h2> -</DIV> - - <DIV> -<H2> -<br> -About the BenchmarkHierarchicalClient Example </H2> -<P>The <code>BenchmarkHierarchicalClient</code> example is an interactive C# program that uses Microsoft .NET Framework 4.0 to access the GemFire C++ API for benchmarking performance between a client and a server.</P> -<blockquote> - <p align="left"><em>Microsoft .NET Framework 4.0 must be installed before running this example. For information about installing the .NET Framework, see the </em>GemFire Native Client User's Guide<em>.</em></p> -</blockquote> -<P><code>BenchmarkHierarchicalClient</code> measures the time it takes for a <code>put</code> operation to return in a hierarchical cache configuration. In this test, the client does the <code>put</code> and its BridgeWriter automatically forwards the <code>put</code> to the server. Consequently, the measurement includes the time required to send the data to the server.</P> -<P>To run the server and client on separate machines, you need to modify the client configuration file, <a href="./BenchmarkHierarchicalClient.xml" target="_blank"><code>BenchmarkHierarchicalClient.xml</code></a>, changing the two occurrences of the endpoints parameter string, <code>localhost</code>, to the name of the server's machine.</P> - </DIV> - -<DIV> -<H2> -<a name="configuring_environment" id="configuring_environment"></a>Configuring the Environment </H2> -<P> -Examples that interact with a Java cache server require specific environment configurations so the Java cache server will run properly. Follow the configuration steps listed below that apply to your operating system: </P> -</DIV> - <DIV> -<ol> - <li>From the GemFire product installation directory, configure your environment settings by following the steps in <code>examples/EnvSetup.html</code>.<br> - <br> - <li>Set the <code>JAVA_HOME</code> and <code>GF_JAVA_HOME</code> environment variables to your installed Java JRE or JDK. See the Installation chapter of the <em>GemFire User's Guide</em> for the versions of Java that are compatible with GemFire. The <code>JAVA_HOME</code> setting is for your applications, and <code>GF_JAVA_HOME</code> is for the GemFire scripts. You must have a compatible Java JRE or JDK installed and you must set <code>JAVA_HOME</code> and <code>GF_JAVA_HOME</code> to point to it.<br> - <br> - <li>Add <code>$JAVA_HOME/bin</code> to the start of your <code>PATH</code>. <br> - <br> - <li>Add the GemFire quickstart classes to your <code>CLASSPATH</code>. <br> - <blockquote> - <p><strong> <code><strong>set CLASSPATH=%GEMFIRE%\quickstart\classes;%CLASSPATH%</strong></code></strong></p> -</blockquote> -</ol> -<p>The following is a list of the environment configuration commands for the <code>BenchmarkHierarchicalClient</code> example. Choose the set of commands that are appropriate for your operating system. The text that you type is shown in bold. - These configurations only need to be performed for the sessions that invoke the Java cache server.</p> -<p><strong>Bourne and Korn shells (sh, ksh, bash)</strong></p> -<blockquote> - <p> <code>% <strong>cd GemFireInstallDirectory</strong><br> - % <strong>CLASSPATH=$CLASSPATH:$GEMFIRE/quickstart/classes; export CLASSPATH</strong><br> - % <strong>cd $GEMFIRE/quickstart</strong><br> - % <strong>JAVA_HOME=<installed JRE PATH>; export JAVA_HOME</strong><br> - % <strong>GF_JAVA_HOME=$JAVA_HOME; export GF_JAVA_HOME</strong><br> - % <strong>PATH=$JAVA_HOME/bin:$PATH; export PATH</strong></code></p> -</blockquote> -<p><strong>Windows</strong></p> -<blockquote> - <p><code>> <strong>cd GemFireInstallDirectory</strong><br> -> <strong>set CLASSPATH=%GEMFIRE%\quickstart\classes;%CLASSPATH%</strong><br> -> <strong>cd %GEMFIRE%\quickstart</strong><br> -> <strong>set JAVA_HOME=<installed JRE PATH></strong><br> -> <strong>set GF_JAVA_HOME=%JAVA_HOME%</strong><br> -> <strong>set PATH=%JAVA_HOME%\bin;%PATH%</strong> </code></p> -</blockquote> -</DIV> - -<DIV> -<H2> -Starting BenchmarkHierarchicalClient </H2> -<P> -To start the <code>BenchmarkHierarchicalClient</code> example, create a session from the GemFire product installation directory and complete the following steps. Throughout this example, when you're prompted to enter the native client directory, replace the <code>xxxx</code> in <code>NativeClient_xxxx</code> with the actual four-digit product version number.</P> -<P>This first session starts the Java cache server. </P> -</DIV> -<DIV> -<OL> -<LI CLASS="Numbered-1st"><p> -Configure the session environment according to the steps listed in <a href="#configuring_environment">Configuring the Environment</a><a href="../envsetup.html" target="_blank"></a>.</p> -</LI> -<LI CLASS="Numbered-1st">If you have not already done so, go to the <code>%GEMFIRE%/quickstart</code> directory.</LI> -<blockquote> - <p><strong> <code>cd %GEMFIRE%/quickstart</code></strong></p> -</blockquote> -<LI CLASS="Numbered"> -Enter this command to start the Java cache server: - - <blockquote> - <p><strong> - <code>java quickstart.BenchmarkHierarchicalServer</code></strong></p> - </blockquote> - </LI> -<LI CLASS="Numbered"> -Create another session and change its working directory to the native client <code>cli_BenchmarkHierarchicalClient</code> example directory: - <blockquote> - <p><strong><code>cd examples\cli_BenchmarkHierarchicalClient</code></strong></p> - </blockquote> - <li> - Start the <code>BenchmarkHierarchicalClient</code> application:</li> - <blockquote> - <p><strong> - <code>BenchmarkHierarchicalClient.exe</code></strong></p> - </blockquote> -</OL> -</DIV> -<DIV> -<H2> -Running the Example </H2> -</DIV> -<DIV> -<P><strong> -In the client session</strong></P> -<blockquote> - <p> - The benchmarking tests may take several moments to finish. After the benchmarking is complete, the following statistical categories are reported in the client session:</p> - <blockquote class="style1"> - <p><code>Benchmark Statistics</code></p> - <p><code>Benchmark Averages (Mean)</code></p> - <p><code>Best Benchmark Results </code></p> - </blockquote> -</blockquote> -<blockquote> - <p> When you have finished reviewing the benchmarking results, press <code>Enter</code> to end the <code>BenchmarkHierarchicalClient</code> application. Next, type <strong><code>Exit</code></strong> to close the session.</p> -</blockquote> -<p><strong>In the server session</strong></p> -<blockquote> - <p>Press <code>Enter</code> to end the cache server, then type <strong><code>Exit</code></strong> to close the session.</p> -</blockquote> -</DIV> -<DIV> -<H2> -Changing System Parameters</H2> -<P> -This product ships configured to run with default system properties. If you need to run in a non-default configuration, GemFire also takes a system-level configuration file. To configure a .NET client, rename any <code>gfcpp.properties</code> file currently in the example directory, then copy <code>gfcpp.properties</code> file into your <code>cli_BenchmarkHierarchicalClient</code> directory from the <code>defaultSystem</code> directory. Edit the <code>gfcpp.properties</code> file in your <code>cli_BenchmarkHierarchicalClient</code> directory, as needed.</P> -<P>If you also need to make a non-default configuration for the Java cache server, rename any <code>gemfire.properties</code> file currently in the <code>%GEMFIRE%/quickstart</code>, then copy <code>gemfire.properties</code> into the <code>/quickstart</code> directory from the <code>%GEMFIRE%/defaultConfigs</code> directory and edit it. For example, to change the name of the <code>cache.xml</code> file, uncomment this line and change the file name:</P> -<P> <code>#cache-xml-file=cache.xml</code></P> -<P>When you're done with the example, delete your edited versions of <code>gemfire.properties</code> and <code>gfcpp.properties</code>, then restore the renamed original versions to their original names so other examples can use the unedited files.<code><br> - <br> -</code></P> -</DIV> -<a href="#Top">Top</a> -<P> -<br> -</BODY> -</HTML> - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/CacheRunner.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/CacheRunner.cs b/examples/clicache/CacheRunner/CacheRunner.cs deleted file mode 100644 index d49a92f..0000000 --- a/examples/clicache/CacheRunner/CacheRunner.cs +++ /dev/null @@ -1,708 +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.Geode.Client.Examples -{ - using Apache.Geode.Client.Tests; - using Apache.Geode.Client; - - // Example class to perform puts/gets using one or more clients. - class CacheRunner - { - #region Local constants - - private static string DefaultXMLPath = "tcr_cache.xml"; - - #endregion - - #region Private static members - - private static Cache m_cache = null; - private static Region m_region = null; - - #endregion - - static void Main(string[] args) - { - try - { - // Connect to distributed system and cache - DSInit(args); - - // Enter puts and gets manually - DoCommand(); - } - catch (Exception ex) - { - Console.WriteLine("{0}An exception occurred: {1}", - Environment.NewLine, ex.Message); - Console.WriteLine("---[ Press <Enter> to End the Application ]---"); - Console.ReadLine(); - } - finally - { - try - { - // Close the cache and disconnect - DSClose(); - } - catch // Ignore any exception here. - { - } - } - } - - #region Local functions - - // Initialize the distributed system, setup the cache, register callbacks - // and user-defined classes and create the region. - public static void DSInit(string[] args) - { - Console.WriteLine("{0}Connecting to GemFire{0}", Environment.NewLine); - - // Register the ComplexNumber type - Serializable.RegisterType(ComplexNumber.Create); - - // Register the Portfolio and Position classes for Query - Serializable.RegisterType(Portfolio.CreateDeserializable); - Serializable.RegisterType(Position.CreateDeserializable); - - // Register the ExampleObject for putall and interop - Serializable.RegisterType(ExampleObject.CreateDeserializable); - - string xmlPath; - // Create a cache - if (args != null && args.Length > 1) - { - throw new ApplicationException(string.Format("Usage: CacheRunner " + - "[<XML file name>]{0}\tXML file name is optional " + - "and the default is {1}.", Environment.NewLine, DefaultXMLPath)); - } - else if (args != null && args.Length == 1) - { - xmlPath = args[0]; - } - else - { - xmlPath = DefaultXMLPath; - } - CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(null); - m_cache = cacheFactory.Set("cache-xml-file", xmlPath).Create(); - Region[] rootRegions = m_cache.RootRegions(); - if (rootRegions != null && rootRegions.Length > 0) - { - SetRegion(rootRegions[rootRegions.Length - 1]); - } - else - { - throw new ApplicationException("No root regions found."); - } - } - - // Close the cache and disconnect from the distributed system. - public static void DSClose() - { - // Close cache - if (m_cache != null) - { - m_cache.Close(); - m_cache = null; - - Console.WriteLine("{0}Closed cache", Environment.NewLine); - } - Console.WriteLine("{0}Connection closed", Environment.NewLine); - } - - private static void SetRegion(Region region) - { - m_region = region; - RegionAttributes attrs = m_region.Attributes; - if (attrs.ClientNotificationEnabled) - { - m_region.RegisterAllKeys(); - } - // Add cache listener callback to region - if (attrs.CacheListener == null) - { - ExampleCacheListenerCallback listenerCallback = - new ExampleCacheListenerCallback(); - AttributesMutator mutator = m_region.GetAttributesMutator(); - mutator.SetCacheListener(listenerCallback); - } - } - - // Puts a string key and complex number value - public static void PutComplex(string key, ComplexNumber value) - { - m_region.Put(key, value); - Console.WriteLine("Put complex -- key: " + key + " value: " + value); - } - - // Puts a string key and string value - public static void PutStr(string key, string value) - { - m_region.Put(key, value); - Console.WriteLine("Put string -- key: " + key + " value: " + value); - } - - // Puts a string key and bytes value - public static void PutBytes(string key, string value) - { - byte[] buffer = new byte[value.Length]; - for (int index = 0; index < value.Length; index++) - { - buffer[index] = (byte)value[index]; - } - m_region.Put(key, buffer); - Console.WriteLine("Put string -- key: " + key + " value: " + value); - } - - // Puts a string key and object - public static void PutObject(string key, IGFSerializable cValue) - { - m_region.Put(key, cValue); - Console.WriteLine("Put -- key: " + key + " value: " + cValue); - } - - // Puts a string key and portfolio object - public static void PutPortfolio(string key, int id) - { - Portfolio portfolio = new Portfolio(id, 2); - m_region.Put(key, portfolio); - Console.WriteLine("Put portfolio -- key: " + key + " id: " + id); - } - - // Puts a string key and position object - public static void PutPosition(string key, int id) - { - Position position = new Position(key, id); - m_region.Put(key, position); - Console.WriteLine("Put position -- key: " + key + " id: " + id); - } - - // Gets the value, if the key exists - public static string GetStr(string key) - { - string testStr = string.Empty; - - IGFSerializable cValue = m_region.Get(key); - // Is the key found? - if (cValue != null) - { - testStr = cValue.ToString(); - - // Type of value? - if (cValue is CacheableBytes) - { - System.Text.StringBuilder sb = new System.Text.StringBuilder(); - CacheableBytes cBytes = cValue as CacheableBytes; - foreach (byte b in cBytes.Value) - { - sb.Append((char)b); - } - testStr = sb.ToString(); - } - else if (cValue is CacheableObjectXml) - { - object val = ((CacheableObjectXml)cValue).Value; - System.Xml.XmlDocument xd = val as System.Xml.XmlDocument; - if (xd != null) - { - testStr = xd.OuterXml; - } - } - Console.WriteLine("Get [{0}] -- key: {1}, value: {2}", - cValue.GetType().Name, key, testStr); - } - else - { - testStr = "NULL"; - Console.WriteLine("No such key in region: " + key); - } - - return testStr; - } - - // Run the given query - public static void RunQuery(string query, bool isRegionQuery) - { - try - { - ISelectResults results = null; - - if (isRegionQuery) - { - results = m_region.Query(query); - } - else - { - QueryService qs = m_cache.GetQueryService("examplePool"); - Query qry = qs.NewQuery(query); - results = qry.Execute(); - } - if (results is ResultSet) - { - uint index = 1; - foreach (IGFSerializable result in results) - { - Console.WriteLine("\tResult {0}: {1}", index, result); - index++; - } - } - else - { - StructSet ss = (StructSet)results; - Console.Write("Columns:"); - uint index = 0; - string colName; - while ((colName = ss.GetFieldName(index)) != null) - { - Console.Write('\t' + colName); - index++; - } - Console.WriteLine(); - index = 1; - foreach (Struct si in results) - { - Console.Write("\tResult {0}: "); - while (si.HasNext()) - { - Console.Write(si.Next() + " || "); - } - Console.WriteLine(); - index++; - } - } - } - catch (Exception ex) - { - Console.WriteLine("Exception while running the query [{0}]: {1}", - query, ex.Message); - } - } - - // Run the given query and display the single result value - public static void SelectValue(string query) - { - try - { - IGFSerializable result = m_region.SelectValue(query); - - if (result is Struct) - { - Struct si = result as Struct; - Console.Write("Columns:"); - uint index = 0; - string colName; - while ((colName = si.Set.GetFieldName(index)) != null) - { - Console.Write('\t' + colName); - index++; - } - Console.WriteLine(); - - index = 0; - Console.Write("\tResult {0}: "); - while (si.HasNext()) - { - Console.Write(si.Next() + " || "); - } - Console.WriteLine(); - index++; - } - else - { - Console.WriteLine("\tResult : {0}", result); - } - } - catch (Exception ex) - { - Console.WriteLine("Exception while running the query [{0}]: {1}", - query, ex.Message); - } - } - - private static int getTS(DateTime ts) - { - int ms = (ts.Hour * 3600 + ts.Minute * 60 + ts.Second) * 1000 + ts.Millisecond; - return ms; - } - - // Run the given query and display if value exists - public static void ExistsValue(string query) - { - try - { - bool result = m_region.ExistsValue(query); - - Console.WriteLine("\tResult is {0}", result); - } - catch (Exception ex) - { - Console.WriteLine("Exception while running the query [{0}]: {1}", - query, ex.Message); - } - } - - // Waits for input of a command (chrgn, get, put, putAll, exec, query, - // existsvalue, selectvalue or quit), then does just that. - public static void DoCommand() - { - string myCmd = string.Empty; - string myKey; - string myValue; - - while (myCmd != "quit") - { - Console.Write("{0}: chrgn, lsrgn, get, put, putAll, run, exec, query, " + - "existsvalue, selectvalue, quit: ", m_region.FullPath); - - string strIn = Console.ReadLine().Trim(); - string[] strSplit = strIn.Split(' '); - - myCmd = strSplit[0]; - myCmd = myCmd.ToLower(); - - if (myCmd == "q") { myCmd = "quit"; } - - switch (myCmd) - { - case "chrgn": - if (strSplit.Length == 2) - { - string regionPath = strSplit[1].Trim(); - Region region = null; - try - { - region = m_cache.GetRegion(regionPath); - } - catch - { - } - if (region == null) - { - Console.WriteLine("No region {0} found.", regionPath); - Console.WriteLine("usage: chrgn region-path"); - } - else - { - SetRegion(region); - } - } - else - { - Console.WriteLine("usage: chrgn region-path \t change the " + - "current region to the given region; the region-path can " + - "be absolute or relative to the current region"); - } - break; - - case "lsrgn": - Region[] rootRegions = m_cache.RootRegions(); - Console.Write("\nNumber of regions in Cache: {0}\n", rootRegions.Length); - int count = 1; - for (int rgnCnt = 0; rgnCnt < rootRegions.Length; rgnCnt++) - { - Console.Write("Region Name {0}: {1}\n",count++,rootRegions[rgnCnt].Name); - } - break; - - case "run": - if (strSplit.Length == 3) - { - string myNumber = strSplit[1]; - string mySize = strSplit[2]; - int number = int.Parse(myNumber); - int size = int.Parse(mySize); - byte[] payload = new byte[size]; - - CacheableHashMap map = new CacheableHashMap(); - int ts1 = getTS(System.DateTime.Now); - for (int i = 0; i < number; i++) - { - if (size == 0) - { - map.Add(new CacheableInt32(i), new ExampleObject(i)); - } - else - { - map.Add(CacheableInt32.Create(i), - CacheableBytes.Create(payload)); - } - } - m_region.PutAll(map); - int ts2 = getTS(System.DateTime.Now); - Double run_t = (ts2 - ts1) / 1000.0; - Console.WriteLine("Ops/sec: {0}, {1}, {2}", number / run_t, ts1, ts2); - } else { - Console.WriteLine("usage: run numOfKeys entrySize"); - } - break; - - case "putall": - if (strSplit.Length == 3) - { - myKey = strSplit[1]; - myValue = strSplit[2]; - int num = int.Parse(myValue); - - //byte[] payload = new byte[10]; - //for (int index = 0; index < 10; index++) - //{ - //payload[index] = 1; - //} - - Console.WriteLine("putAll: " + myKey + ":" + num); - - CacheableHashMap map = new CacheableHashMap(); - map.Clear(); - for (int i = 0; i < num; i++) - { - string key = myKey + i; - // map.Add(new CacheableString(key), (CacheableBytes)(payload)); - map.Add(new CacheableString(key), new ExampleObject(i)); - // map.Add(new CacheableString(key), new Position(i)); - } - m_region.PutAll(map); - } else { - Console.WriteLine("usage: putAll keyBase numOfKeys"); - } - break; - - case "put": - if (strSplit.Length == 3) - { - myKey = strSplit[1]; - myValue = strSplit[2]; - - // Check to see if value is ComplexNumber or String - ComplexNumber cNum = ComplexNumber.Parse(myValue); - - if (cNum != null) - { - // Put the key and value - PutComplex(myKey, cNum); - } - else - { - // Put the key and value - PutStr(myKey, myValue); - } - } - else if (strSplit.Length == 4) - { - myKey = strSplit[1]; - myValue = strSplit[2]; - string type = strSplit[3]; - type = type.ToLower(); - - switch (type) - { - case "str": - PutStr(myKey, myValue); - break; - - case "bytes": - PutBytes(myKey, myValue); - break; - - case "complex": - ComplexNumber cNum = ComplexNumber.Parse(myValue); - if (cNum != null) - { - PutComplex(myKey, cNum); - } - else - { - Console.WriteLine("Could not parse the complex number."); - } - break; - - case "double": - double dval = 0.0; - try - { - dval = double.Parse(myValue); - } - catch (Exception ex) - { - Console.WriteLine("Double value [{0}] not valid: {1}.", myValue, ex); - break; - } - PutObject(myKey, new CacheableDouble(dval)); - break; - - case "float": - float fval = 0.0F; - try - { - fval = float.Parse(myValue); - } - catch (Exception ex) - { - Console.WriteLine("Float value [{0}] not valid: {1}.", myValue, ex); - break; - } - PutObject(myKey, new CacheableFloat(fval)); - break; - - case "obj": - string xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; - xmlStr += "<IndexMessage xmlns=\"urn:example.com:FinanceManager.Messages:v1.0\">"; - xmlStr += "<Keys>11</Keys><Keys>22</Keys><Keys>33</Keys></IndexMessage>"; - - System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); - xd.LoadXml(xmlStr); - PutObject(myKey, CacheableObjectXml.Create(xd)); - break; - - case "port": - int id = 0; - try - { - id = int.Parse(myValue); - } - catch - { - Console.WriteLine("Portfolio value [{0}] not a valid" - + " integer ID.", myValue); - break; - } - PutPortfolio(myKey, id); - break; - - case "pos": - int id2 = 0; - try - { - id2 = int.Parse(myValue); - } - catch - { - Console.WriteLine("Position value [{0}] not a valid" - + " integer ID.", myValue); - break; - } - PutPosition(myKey, id2); - break; - - default: - Console.WriteLine("usage: put key value [str|bytes|complex|double|float|obj|port|pos]"); - break; - } - } - else - { - Console.WriteLine("usage: put key value [str|bytes|complex|double|float|obj|port|pos]"); - } - break; - - case "get": - if (strSplit.Length == 2) - { - myKey = strSplit[1]; - - // Get the value - string xStr = GetStr(myKey); - } - else - { - Console.WriteLine("usage: get key"); - } - - break; - - case "exec": - if (strSplit.Length > 1) - { - string query = string.Empty; - for (int index = 1; index < strSplit.Length; index++) - { - query += strSplit[index] + ' '; - } - query = query.Trim(); - RunQuery(query, false); - } - else - { - Console.WriteLine("usage: exec <select query string>"); - } - - break; - - case "query": - if (strSplit.Length > 1) - { - string query = string.Empty; - for (int index = 1; index < strSplit.Length; index++) - { - query += strSplit[index] + ' '; - } - query = query.Trim(); - RunQuery(query, true); - } - else - { - Console.WriteLine("usage: query <query predicate>"); - } - - break; - - case "existsvalue": - if (strSplit.Length > 1) - { - string query = string.Empty; - for (int index = 1; index < strSplit.Length; index++) - { - query += strSplit[index] + ' '; - } - query = query.Trim(); - ExistsValue(query); - } - else - { - Console.WriteLine("usage: existsvalue <query predicate>"); - } - - break; - - case "selectvalue": - if (strSplit.Length > 1) - { - string query = string.Empty; - for (int index = 1; index < strSplit.Length; index++) - { - query += strSplit[index] + ' '; - } - query = query.Trim(); - SelectValue(query); - } - else - { - Console.WriteLine("usage: selectvalue <query predicate>"); - } - - break; - } - } - } - - #endregion - } -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/CacheRunner.csproj ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/CacheRunner.csproj b/examples/clicache/CacheRunner/CacheRunner.csproj deleted file mode 100644 index c9d61a7..0000000 --- a/examples/clicache/CacheRunner/CacheRunner.csproj +++ /dev/null @@ -1,145 +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. ---> -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{D8F67104-CDDE-433F-A8EE-470A92180AB9}</ProjectGuid> - <OutputType>Exe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Apache.Geode.Client.Examples</RootNamespace> - <AssemblyName>CacheRunner</AssemblyName> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\CacheRunner\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\CacheRunner\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <PlatformTarget>x86</PlatformTarget> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\CacheRunner\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\CacheRunner\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <PlatformTarget>x86</PlatformTarget> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> - <DebugSymbols>true</DebugSymbols> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\CacheRunner\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\CacheRunner\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <PlatformTarget>x64</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoWarn>618</NoWarn> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> - <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\CacheRunner\</IntermediateOutputPath> - <OutputPath>$(OSBUILDDIR)\examples\clicache\CacheRunner\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <Optimize>true</Optimize> - <DebugType>pdbonly</DebugType> - <PlatformTarget>x64</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <NoWarn>618</NoWarn> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.XML" /> - </ItemGroup> - <ItemGroup> - <Compile Include="..\..\..\tests\clicache\TestObject\Portfolio.cs"> - <Link>Portfolio.cs</Link> - </Compile> - <Compile Include="..\..\..\tests\clicache\TestObject\Position.cs"> - <Link>Position.cs</Link> - </Compile> - <Compile Include="CacheRunner.cs" /> - <Compile Include="Callbacks.cs" /> - <Compile Include="ComplexNumber.cs" /> - <Compile Include="ExampleObject.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\..\vs_projects\gfclicache\gfclicache.vcproj"> - <Project>{B274E3B1-6A09-4322-952B-8BDA712892CE}</Project> - <Name>gfclicache</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <Content Include="..\..\dist\cacheRunner\cacherunner.xml"> - <Link>cacherunner.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\cacherunner2.xml"> - <Link>cacherunner2.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\csQueryPortfolios.xml"> - <Link>csQueryPortfolios.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\csQueryPortfolios2.xml"> - <Link>csQueryPortfolios2.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\tcr_cache.xml"> - <Link>tcr_cache.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\tcr_cacheless.xml"> - <Link>tcr_cacheless.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\tcr_hacache.xml"> - <Link>tcr_hacache.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\dist\cacheRunner\tcr_hacacheless.xml"> - <Link>tcr_hacacheless.xml</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\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/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/CacheRunner.csproj.user ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/CacheRunner.csproj.user b/examples/clicache/CacheRunner/CacheRunner.csproj.user deleted file mode 100644 index 167cee3..0000000 --- a/examples/clicache/CacheRunner/CacheRunner.csproj.user +++ /dev/null @@ -1,22 +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. ---> -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <ReferencePath>$(OSBUILDDIR)\hidden\lib\</ReferencePath> - <ProjectView>ProjectFiles</ProjectView> - </PropertyGroup> -</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/Callbacks.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/Callbacks.cs b/examples/clicache/CacheRunner/Callbacks.cs deleted file mode 100644 index a4a074a..0000000 --- a/examples/clicache/CacheRunner/Callbacks.cs +++ /dev/null @@ -1,94 +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.Geode.Client.Examples -{ - /// <summary> - /// Capture and display cache events. - /// </summary> - class ExampleCacheListenerCallback : ICacheListener - { - public static ICacheListener Create() - { - return new ExampleCacheListenerCallback(); - } - - #region ICacheListener Members - - public void AfterCreate(EntryEvent ev) - { - Console.WriteLine("{0}--- Received afterCreate event of: {1}", - Environment.NewLine, ev.Key); - } - - public void AfterDestroy(EntryEvent ev) - { - Console.WriteLine("{0}--- Received afterDestroy event of: {1}", - Environment.NewLine, ev.Key); - } - - public void AfterInvalidate(EntryEvent ev) - { - Console.WriteLine("{0}--- Received afterInvalidate event of: {1}", - Environment.NewLine, ev.Key); - } - - public void AfterRegionClear(RegionEvent ev) - { - Console.WriteLine("{0}--- Received afterRegionClear event of region: {1}", - Environment.NewLine, ev.Region.Name); - } - - public void AfterRegionDestroy(RegionEvent ev) - { - Console.WriteLine("{0}--- Received afterRegionDestroy event of region: {1}", - Environment.NewLine, ev.Region.Name); - } - - public void AfterRegionInvalidate(RegionEvent ev) - { - Console.WriteLine("{0}--- Received afterRegionInvalidate event of region: {1}", - Environment.NewLine, ev.Region.Name); - } - - public void AfterRegionLive(RegionEvent ev) - { - Console.WriteLine("{0}--- Received afterRegionLive event of region: {1}", - Environment.NewLine, ev.Region.Name); - } - - public void AfterUpdate(EntryEvent ev) - { - Console.WriteLine("{0}--- Received afterUpdate event of: {1}", - Environment.NewLine, ev.Key); - } - - public void Close(Region region) - { - Console.WriteLine("{0}--- Received close event of region: {1}", - Environment.NewLine, region.Name); - } - public void AfterRegionDisconnected(Region region) - { - Console.WriteLine("{0}--- Received disconnected event of region: {1}", - Environment.NewLine, region.Name); - } - #endregion - } -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/ComplexNumber.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/ComplexNumber.cs b/examples/clicache/CacheRunner/ComplexNumber.cs deleted file mode 100644 index 7297c69..0000000 --- a/examples/clicache/CacheRunner/ComplexNumber.cs +++ /dev/null @@ -1,215 +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.Text.RegularExpressions; - -namespace Apache.Geode.Client.Examples -{ - /// <summary> - /// A complex number -- no operations defined yet. - /// </summary> - public class ComplexNumber : Apache.Geode.Client.ICacheableKey - { - #region Public Accessors - - /// <summary> - /// The real portion of the complex number. - /// </summary> - public double Real - { - get - { - return m_real; - } - set - { - m_real = value; - } - } - - /// <summary> - /// The imaginary portion of the complex number. - /// </summary> - public double Imaginary - { - get - { - return m_imaginary; - } - set - { - m_imaginary = value; - } - } - - #endregion - - #region Private members - - private double m_real; - private double m_imaginary; - - #endregion - - #region Constructor and factory function - - /// <summary> - /// Constructor. - /// </summary> - /// <param name="real">Real part</param> - /// <param name="imaginary">Imaginary part</param> - public ComplexNumber(double real, double imaginary) - { - m_real = real; - m_imaginary = imaginary; - } - - /// <summary> - /// Factory function to be registered using - /// <see cref="Serializable.registerType" />. - /// </summary> - public static Apache.Geode.Client.IGFSerializable Create() - { - return new ComplexNumber(0.0, 0.0); - } - - #endregion - - #region Serialization -- IGFSerializable members - - /// <summary> - /// Read the complex number from the <see cref="DataInput" /> stream. - /// </summary> - /// <param name="input">The <c>DataInput</c> stream.</param> - /// <returns>A reference to <c>this</c> object.</returns> - public Apache.Geode.Client.IGFSerializable FromData(Apache.Geode.Client.DataInput input) - { - m_real = input.ReadDouble(); - m_imaginary = input.ReadDouble(); - return this; - } - - /// <summary> - /// Write the complex number to the <see cref="DataOutput" /> stream. - /// </summary> - /// <param name="output">The <c>DataOutput</c> stream.</param> - public void ToData(Apache.Geode.Client.DataOutput output) - { - output.WriteDouble(m_real); - output.WriteDouble(m_imaginary); - } - - /// <summary> - /// return the size of this object in bytes - /// </summary> - public UInt32 ObjectSize - { - get - { - return (UInt32) (sizeof(double) + sizeof(double)); - } - } - - /// <summary> - /// Get the <see cref="IGFSerializable.ClassId" /> of this class. - /// </summary> - /// <returns>The classId.</returns> - public UInt32 ClassId - { - get - { - return 0x04; - } - } - - #endregion - - #region ICacheableKey Members - - public bool Equals(Apache.Geode.Client.ICacheableKey other) - { - ComplexNumber cOther = other as ComplexNumber; - if (cOther != null) - { - return (m_real == cOther.m_real) && (m_imaginary == cOther.m_imaginary); - } - return false; - } - - /// <summary> - /// Gets the hashcode by XORing the hashcodes of real and imaginary parts - /// </summary> - public override int GetHashCode() - { - return m_real.GetHashCode() ^ m_imaginary.GetHashCode(); - } - - #endregion - - #region Overridden System.Object members - - /// <summary> - /// Check whether this <c>ComplexNumber</c> is equal to the given object. - /// </summary> - /// <param name="obj">The object to use compare to.</param> - /// <returns>True if the object is equal, false otherwise.</returns> - public override bool Equals(object obj) - { - if (obj is ComplexNumber) - { - ComplexNumber other = obj as ComplexNumber; - return (m_real == other.m_real) && (m_imaginary == other.m_imaginary); - } - return false; - } - - /// <summary> - /// Get a string representation of the form 'a+bi' for this complex number. - /// </summary> - /// <returns>The string representation of this object.</returns> - public override string ToString() - { - return m_real.ToString() + '+' + m_imaginary.ToString() + 'i'; - } - - #endregion - - #region Read string representation and create new ComplexNumber - - /// <summary> - /// A convenience Parse method to get a ComplexNumber from a given string. - /// The format is expected to be of the form a+bi, such as "7+3.14i". - /// </summary> - /// <param name="s">The string to parse.</param> - /// <returns>The ComplexNumber that this string represents; null if format not correct.</returns> - public static ComplexNumber Parse(string s) - { - const string dbPat = @"([0-9]+)|([0-9]*\.[0-9]+)"; - Match mt = Regex.Match(s, @"^\s*(?<REAL>" + dbPat + @")\s*\+\s*(?<IM>" + dbPat + @")i\s*$"); - if (mt != null && mt.Length > 0) - { - double real = double.Parse(mt.Groups["REAL"].Value); - double imaginary = double.Parse(mt.Groups["IM"].Value); - return new ComplexNumber(real, imaginary); - } - return null; - } - - #endregion - } -} http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/ExampleObject.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/ExampleObject.cs b/examples/clicache/CacheRunner/ExampleObject.cs deleted file mode 100755 index 7daccd6..0000000 --- a/examples/clicache/CacheRunner/ExampleObject.cs +++ /dev/null @@ -1,238 +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. - */ - -/* - * @brief ExampleObject class for testing the put functionality for object. - */ - -using System; -namespace Apache.Geode.Client.Examples -{ - public class ExampleObject - : IGFSerializable - { - #region Private members - private double double_field; - private float float_field; - private long long_field; - private int int_field; - private short short_field; - private string string_field; - private System.Collections.ArrayList string_vector = new System.Collections.ArrayList(); - #endregion - - #region Public accessors - public int Int_Field - { - get - { - return int_field; - } - set - { - int_field = value; - } - } - public short Short_Field - { - get - { - return short_field; - } - set - { - short_field = value; - } - } - public long Long_Field - { - get - { - return long_field; - } - set - { - long_field = value; - } - } - public float Float_Field - { - get - { - return float_field; - } - set - { - float_field = value; - } - } - public double Double_Field - { - get - { - return double_field; - } - set - { - double_field = value; - } - } - public string String_Field - { - get - { - return string_field; - } - set - { - string_field = value; - } - } - public System.Collections.ArrayList String_Vector - { - get - { - return string_vector; - } - set - { - string_vector = value; - } - } - public override string ToString() - { - string buffer = "ExampleObject: "+int_field+"(int),"+string_field+"(str),"; - buffer += "["; - for (int idx = 0; idx < string_vector.Count; idx++) - { - buffer += string_vector[idx]; - } - buffer += "(string_vector)]"; - return buffer; - } - #endregion - - #region Constructors - public ExampleObject() - { - double_field = (double)0.0; - float_field = (float)0.0; - long_field = 0; - int_field = 0; - short_field = 0; - string_field = ""; - string_vector.Clear(); - } - - public ExampleObject(int id) { - int_field = id; - short_field = (Int16)id; - long_field = (Int64)id; - float_field = (float)id; - double_field = (double)id; - string_field = ""+id; - string_vector.Clear(); - for (int i=0; i<3; i++) { - string_vector.Add(string_field); - } - } - public ExampleObject(string sValue) { - int_field = Int32.Parse(sValue); - long_field = Int64.Parse(sValue); - short_field = Int16.Parse(sValue); - double_field = (double)int_field; - float_field = (float)int_field; - string_field = sValue; - string_vector.Clear(); - for (int i=0; i<3; i++) { - string_vector.Add(sValue); - } - } - #endregion - - #region IGFSerializable Members - public IGFSerializable FromData(DataInput input) - { - double_field = input.ReadInt64(); - float_field = input.ReadFloat(); - long_field = input.ReadInt64(); - int_field = input.ReadInt32(); - short_field = input.ReadInt16(); - string_field = input.ReadUTF(); - int itemCount = input.ReadInt32(); - string_vector.Clear(); - for (int idx = 0; idx<itemCount; itemCount++) { - string_vector.Add(input.ReadUTF()); - } - return this; - } - - public void ToData(DataOutput output) - { - output.WriteDouble( double_field ); - output.WriteFloat( float_field ); - output.WriteInt64( long_field ); - output.WriteInt32( int_field ); - output.WriteInt16( short_field ); - output.WriteUTF( string_field ); - int itemCount = string_vector.Count; - output.WriteInt32( itemCount ); - for( int idx = 0; idx < itemCount; idx++ ) { - string s = (string)string_vector[idx]; - output.WriteUTF( s ); - } - } - - public UInt32 ObjectSize - { - get - { - UInt32 objectSize = 0; - objectSize += (UInt32)sizeof(double); - objectSize += (UInt32)sizeof(float); - objectSize += (UInt32)sizeof(Int64); - objectSize += (UInt32)sizeof(Int32); - objectSize += (UInt32)sizeof(Int16); - objectSize += (UInt32)(string_field == null ? 0 : sizeof(char) * string_field.Length); - objectSize += (UInt32)sizeof(Int32); - for (int idx = 0; idx<string_vector.Count; idx++) { - string s = (string)string_vector[idx]; - objectSize += (UInt32)(string_vector[idx] == null ? 0 : sizeof(char) * s.Length); - } - return objectSize; - } - } - - public UInt32 ClassId - { - get - { - return 0x2e; - } - } - #endregion - - public static IGFSerializable CreateDeserializable() - { - return new ExampleObject(); - } - } - -}; - - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/b2edccfc/examples/clicache/CacheRunner/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/examples/clicache/CacheRunner/Properties/AssemblyInfo.cs b/examples/clicache/CacheRunner/Properties/AssemblyInfo.cs deleted file mode 100644 index 03f0a97..0000000 --- a/examples/clicache/CacheRunner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,49 +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.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GemFireCacheRunner")] -[assembly: AssemblyDescription("GemFire ThinClient PutGet Example")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("GemStone Systems Inc.")] -[assembly: AssemblyProduct("GemFireCacheRunner")] -[assembly: AssemblyCopyright("Copyright © GemStone Systems Inc. 2008")] -[assembly: AssemblyTrademark("All Rights Reserved")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bfe795a5-161f-4bb0-9694-f225e1f465be")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("9.0.0.0")] -[assembly: AssemblyFileVersion("9.0.0.0")]
