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 E44E5200C2A for ; Tue, 14 Feb 2017 20:35:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E2C6D160B7B; Tue, 14 Feb 2017 19:35:35 +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 E2C4C160B85 for ; Tue, 14 Feb 2017 20:35:30 +0100 (CET) Received: (qmail 59203 invoked by uid 500); 14 Feb 2017 19:35:21 -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 57424 invoked by uid 99); 14 Feb 2017 19:35:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 19:35:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 17360E0943; Tue, 14 Feb 2017 19:35:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: abaker@apache.org To: commits@geode.apache.org Date: Tue, 14 Feb 2017 19:36:15 -0000 Message-Id: In-Reply-To: <45f305d00b214008a0ac69ded56b8e3d@git.apache.org> References: <45f305d00b214008a0ac69ded56b8e3d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [57/73] [abbrv] geode-native git commit: GEODE-1964 Move doc files to geode-native subdirectory, add geode-native-book directory, update User Guide sources for donation 2 archived-at: Tue, 14 Feb 2017 19:35:36 -0000 http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/application-callbacks.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/application-callbacks.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/application-callbacks.html.md.erb deleted file mode 100644 index 9b49635..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/application-callbacks.html.md.erb +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Application Callbacks ---- - -For region-level events, an application can use `AttributesFactory.SetCache*` methods to implement and register the `ICacheLoader`, `ICacheWriter`, and `ICacheListener` interfaces to perform custom actions. - -You can use `Region.Put` for simple caching situations. For more complex needs, you should implement the `ICacheLoader` interface and allow the cache to manage the creation and loading of objects. When a `Region.Get `is called for a region entry with a value of null, the `ICacheLoader::Load` method of the cache loader (if any) for the region is invoked. A static `CacheLoader::NetSearch` method is provided which can be used by `ICacheLoader` implementations to locate the requested key in the distributed system. The `ICacheListener` interface can be used to listen to various region events after events such as create, update, or invalidate of region entries have occurred. The `ICacheWriter` interface is invoked before the events have occurred. - -## Using ICacheLoader to Load New Integers in the Region - -This example demonstrates an `ICacheLoader` implementation for loading new integers into a region. - -``` pre -class SimpleCacheLoader : ICacheLoader -{ - #region ICacheLoader Members - public TVal Load(IRegion region, TKey key, object helper) - { - Console.WriteLine("SimpleCacheLoader: Received Load event for region: - {0} and key: {1}", region.Name, key); - return default(TVal); - } - public void Close(IRegion region) - { - Console.WriteLine("SimpleCacheLoader: Received Close event of region: - {0}", region.Name); - } - #endregion -} -``` - -## Using ICacheWriter to Track Creates and Updates for a Region - -This example implements `ICacheWriter` to track region entry `create` and `update` events. This example just reports the events to the screen, but you can do whatever you need to do with the events. - -``` pre -class SimpleCacheWriter : ICacheWriter -{ - #region ICacheWriter Members - public bool BeforeUpdate(EntryEvent ev) - { - Console.WriteLine("SimpleCacheWriter: Received BeforeUpdate event for: {0}", ev.Key); - return true; - } - // ... handle other entry events as needed - public bool BeforeRegionClear(RegionEvent ev) - { - Console.WriteLine("SimpleCacheWriter: Received BeforeRegionClear event of region: {0}", - ev.Region.Name); - return true; - } - // ... handle other region events as needed - #endregion -} -``` - -## A Sample ICacheListener Implementation - -This example implements `ICacheListener`. - -``` pre -class SimpleCacheListener : ICacheListener -{ - #region ICacheListener Members - public void AfterCreate(EntryEvent ev) - { - Console.WriteLine("SimpleCacheListener: Received AfterCreate event - for: {0}", ev.Key); - } - // ... handle other entry events as needed - public void AfterRegionDestroy(RegionEvent ev) - { - Console.WriteLine("SimpleCacheListener: Received AfterRegionDestroy - event of region: {0}", ev.Region.Name); - } - // ... handle other region events as needed - #endregion -} -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/cache-apis.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/cache-apis.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/cache-apis.html.md.erb deleted file mode 100644 index fa36a86..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/cache-apis.html.md.erb +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Cache APIs ---- - -This section describes the `CacheFactory` and `Cache` classes. - -- **CacheFactory class**. Creates a `Cache` instance based on the provided distributed system and cache configuration. Any `gfcpp`.properties and `cache.xml` files provided to the application are used to initialize the system and cache. See [Setting System and Cache Properties](../setting-properties/chapter-overview.html#system_and_cache_properties). If a `cache.xml` file is used to create a cache and some of the regions already exist, a warning states that the regions exist and the cache is created. -- **Cache class**. Entry point to the Geode caching API. This class allows you to create regions. The cache is created by calling the `create` function of the `CacheFactory` class. When creating a cache, you specify a `DistributedSystem` that tells the new cache where to find other caches on the network and how to communicate with them. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/cpp-class-to-dotnet-class-mappings.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/cpp-class-to-dotnet-class-mappings.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/cpp-class-to-dotnet-class-mappings.html.md.erb deleted file mode 100644 index 8a395f6..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/cpp-class-to-dotnet-class-mappings.html.md.erb +++ /dev/null @@ -1,164 +0,0 @@ ---- -title: C++ Class to .NET Class Mappings ---- - -Wherever the native C++ class methods use pass-by-reference semantics to return data, the corresponding .NET methods return the object instead of using pass-by-reference semantics. - - - - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1. C++ Class to .NET Class Mappings

C++ Class

.NET Class

class gemfire::AttributesFactorySealed class AttributesFactory

class gemfire::AttributesMutator

Sealed class AttributesMutator
class gemfire::CacheSealed class Cache

abstract class gemfire::Cacheable

Interface IPdxSerializable or interface IGFSerializable

class gemfire::CacheableBytes

Byte[] or ArrayList<Byte>

class gemfire::Cacheableint32

Int32

class gemfire::CacheableString

String

abstract class gemfire::CacheableKey

You can use any type that implements hashcode and equals. The generic .NET built-in types are all suitable.

abstract class gemfire::CacheListener

Interface ICacheListener

class gemfire::CacheLoader

Interface ICacheLoader plus static class CacheLoader

class gemfire::CacheWriter

Interface class ICacheWriter

class gemfire::CacheFactory

Sealed class CacheFactory

class gemfire::DataInput

With IPdxSerializable, IPdxReader.

-

With IGFSerializable, sealed class DataInput.

class gemfire::DataOutput

With IPdxSerializable, IPdxWriter.

-

With IGFSerializable, sealed class DataOutput .

class gemfire::DiskPolicyType

enum DiskPolicyType plus static class DiskPolicy containing convenience methods for DiskPolicyType enumeration

class gemfire::DistributedSystem

Sealed class DistributedSystem

class gemfire::EntryEvent

Sealed class EntryEvent

class gemfire::Exception

Class GemfireException

all other exceptions deriving from gemfire::Exception

Corresponding exceptions deriving from GemfireException

class gemfire::ExpirationAction

enum ExpirationAction plus static class Expiration containing convenience methods for ExpirationAction enumeration

class gemfire::Log

Static class Log. The native Log::log method is mapped to Log.Write to avoid the conflict with the class name which is reserved for the constructors of Log class. The various loglevel Throw or Catch methods are not implemented, since they are redundant to Log::Log , Log::LogThrow, and Log::LogCatch methods that take LogLevel as a parameter.

enum gemfire::MemberType

enum MemberType

abstract class gemfire::PersistanceManager

Not provided. You can register a C++ implementation using AttributesFactory.SetPersistenceManager but you cannot implement a new one in .NET

class gemfire::Properties

Sealed class Properties

class gemfire::Properties::Visitor

Delegate PropertiesVisitor

abstract class gemfire::Region

Class IRegion

class gemfire::RegionAttributes

Sealed class RegionAttributes

class gemfire::ScopeType

enum ScopeType plus static class Scope containing convenience methods for ScopeType enumeration+

abstract class gemfire::Serializable

Two options:

-
    -
  • Interface IPdxSerializable

  • -
  • Interface IGFSerializable plus wrapper Serializable class for native Serializable and UserData objects. The native toString method is not provided, since the ToString method of the base object class provides the same functionality.

  • -

class gemfire::SystemProperties

Sealed class SystemProperties

class gemfire::UserData

Two options:

-
    -
  • Interface IPdxSerializable

  • -
  • Interface IGFSerializable

  • -

class gemfire::VectorT<T>

Array of the given type, such as T[]

- - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/creating-a-cache.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/creating-a-cache.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/creating-a-cache.html.md.erb deleted file mode 100644 index 1613ba5..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/creating-a-cache.html.md.erb +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: Creating a Cache ---- - -You create a cache using the Geode `CacheFactory.Create` call. Cache creation initializes the distributed system and creates the cache using your `gfcpp.properties` and `cache.xml` file settings and any additional properties you provide to the call. - -See [Setting System and Cache Properties](../setting-properties/chapter-overview.html#system_and_cache_properties) and see [Cache Initialization File](../cache-init-file/chapter-overview.html#chapter-overview). - -## Connecting and Creating the Cache - -In this example, the application connects to the distributed system and creates the cache using the available configuration files. - -The application becomes a distributed system member in the cache Create call. - -``` pre -CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(); -Cache cache = cacheFactory.Create(); -``` - -## Providing Properties to the Cache Creation - -You can also create a cache by referencing a `cache.xml` file, as shown in the following example. You can use the `Properties` object to change any of the `gfcpp.properties` settings. - -``` pre -Properties prop = Properties.Create(); -prop.Insert("cache-xml-file", "cache.xml"); -CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prop); -Cache cache = cacheFactory.Create(); -``` - -For systems with security enabled, the credentials for a joining member are authenticated when the cache is created and the system connection is made. For more information about secure connections to a distributed system, see [Security](../security/overviewsecurity.html#security). - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/creating-a-region.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/creating-a-region.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/creating-a-region.html.md.erb deleted file mode 100644 index e00aa63..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/creating-a-region.html.md.erb +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Creating a Region ---- - -To create a region, you create a `RegionFactory` using the `RegionShortcut` that most closely fits your region configuration. - -From that point, you customize the settings for region attributes as needed. - -Creating a region using the native client API only creates a proxy client side region. A corresponding region with the same name and path must also exist on the servers that have been configured for client connections and upon which the client will perform its operations. - -## Creating a CACHING\_PROXY Region - -This example creates a region using a CACHING\_PROXY RegionShortcut with no further modifications: - -``` pre -RegionFactory regionFactory = - cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); - -IRegion region = regionFactory - .Create("exampleRegion"); -``` - -## Creating a CACHING\_PROXY Region with LRU - -This example creates a region based on the CACHING\_PROXY RegionShortcut with two additional region attributes settings. For information on the settings, see [Region Attributes Descriptions](../client-cache/region-attributes-desc.html#region-attributes-desc). - -``` pre -RegionFactory regionFactory = - cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); -// Create the example Region programmatically. -IRegion region = regionFactory - .SetLruEntriesLimit(20000) - .SetInitialCapacity(20000) - .Create("exampleRegion"); -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-api.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-api.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-api.html.md.erb deleted file mode 100644 index 6bb1495..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-api.html.md.erb +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: About the Native Client .NET API ---- - -The Microsoft .NET Framework interface for the Apache Geode native client provides complete access to the native client C++ functionality from any .NET Framework language (C\#, C++/CLI, VB.NET, and J\#). This enables clients using C\# and other .NET languages to use the capabilities provided by the Geode C++ API. - -The Geode native client uses a set of assemblies managed by the C++ Common Language Infrastructure (C++ CLI). C++ CLI includes the libraries and objects necessary for common language types, and it is the framework for .NET applications. - -The .NET API for the native client adds .NET Framework CLI language binding for the Geode native client product. - -Using C\#, you can write callbacks and define user objects in the cache. The following figure shows an overview of how a C\# application accesses the native client C++ API functionality through C++/CLI . - - -Figure: C\# .NET Application Accessing the C++ API - - - -**Note:** -This chapter uses C\# as the reference language, but other .NET languages work the same way. - -The Geode C\# .NET API is provided in the `GemStone::GemFire::Cache::Generic` namespace. This namespace allows you to manage your cache, regions, and data using the .NET Generics APIs. - -Use the Geode C\# .NET API to programmatically create, populate, and manage a Geode distributed system. - -**Note:** -The C\# .NET library is thread-safe except where otherwise indicated in the online API documentation. - -For complete and current information on the Geode APIs, see the online .NET API documentation. For general information on .NET, see the Microsoft developer’s network website. - -- **[.NET Naming and Usage Conventions](../../nativeclient/dotnet-caching-api/csharp-dotnet-naming-conventions.html)** - - Unless noted, the .NET API classes and functions have the same names as their C++ counterparts in the namespace `GemStone::GemFire::Cache`. In .NET, all method names start with a capital letter. - -- **[Primary APIs](../../nativeclient/dotnet-caching-api/primary-apis-cache-generic.html)** - - These are the main APIs within `GemStone::GemFire::Cache::Generic` used for cache, region, and data entry management in Geode .NET. For detailed information about the APIs, see the .NET API documentation included in the product or available online. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-naming-conventions.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-naming-conventions.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-naming-conventions.html.md.erb deleted file mode 100644 index 51f27f9..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/csharp-dotnet-naming-conventions.html.md.erb +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: .NET Naming and Usage Conventions ---- - -Unless noted, the .NET API classes and functions have the same names as their C++ counterparts in the namespace `GemStone::GemFire::Cache`. In .NET, all method names start with a capital letter. - -The .NET interface names match those of comparable C++ interfaces, but with an ’I’ prepended to satisfy .NET naming conventions. For example, the .NET equivalent of the C++ `CacheLoader` interface is `ICacheLoader`. - -The name of the Geode `Serializable` interface is `IGFSerializable` because `ISerializable` is a .NET built-in type. - -Where possible, get\* and set\* functions are replaced by .NET properties. - -You can implement the Geode .NET interfaces. You cannot extend any of the classes because they are marked as sealed. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/custom-class-igfserializable.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/custom-class-igfserializable.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/custom-class-igfserializable.html.md.erb deleted file mode 100644 index 9cefe3c..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/custom-class-igfserializable.html.md.erb +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: Using a Custom Class With IGFSerializable ---- - -An example shows how to use the `BankAccount` custom key type and the `AccountHistory` value type that were previously defined. - -## Using a BankAccount Object - -``` pre -class AccountHistory : IGFSerializable - { - #region Private members - private List m_history; - #endregion - public AccountHistory() - { - m_history = new List(); - } - public void ShowAccountHistory() - { - Console.WriteLine("AccountHistory:"); - foreach (string hist in m_history) { - Console.WriteLine("\t{0}", hist); - } - } - public void AddLog(string entry) - { - m_history.Add(entry); - } - public static IGFSerializable CreateInstance() - { - return new AccountHistory(); - } - #region IGFSerializable Members - public IGFSerializable FromData(DataInput input) - { - int len = input.ReadInt32(); - m_history.Clear(); - for (int i = 0; i < len; i++) { - m_history.Add(input.ReadUTF()); - } - return this; - } - public void ToData(DataOutput output) - { - output.WriteInt32(m_history.Count); - foreach (string hist in m_history) { - output.WriteUTF(hist); - } - } - public UInt32 ClassId - { - get - { - return 0x05; - } - } - public UInt32 ObjectSize - { - get - { - UInt32 objectSize = 0; - foreach (string hist in m_history) { - objectSize += (UInt32)(hist == null ? 0 : sizeof(char) * hist.Length); - } - return objectSize; - } - } - #endregion - } - public class TestBankAccount - { - public static void Main() - { - // Register the user-defined serializable type. - Serializable.RegisterType(AccountHistory.CreateInstance); - Serializable.RegisterType(BankAccountKey.CreateInstance); - // Create a cache. - CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(null); - Cache cache = cacheFactory.Create(); - // Create a region. - RegionFactory regionFactory = - cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); - Region region = regionFactory.Create("BankAccounts"); - // Place some instances of BankAccount cache region. - BankAccountKey baKey = new BankAccountKey(2309, 123091); - AccountHistory ahVal = new AccountHistory(); - ahVal.AddLog("Created account"); - region.Put(baKey, ahVal); - Console.WriteLine("Put an AccountHistory in cache keyed with - BankAccount."); - // Display the BankAccount information. - Console.WriteLine(baKey.ToString()); - // Call custom behavior on instance of AccountHistory. - ahVal.ShowAccountHistory(); - // Get a value out of the region. - AccountHistory history = region.Get(baKey) as AccountHistory; - if (history != null) - { - Console.WriteLine("Found AccountHistory in the cache."); - history.ShowAccountHistory(); - history.AddLog("debit $1,000,000."); - region.Put(baKey, history); - Console.WriteLine("Updated AccountHistory in the cache."); - } - // Look up the history again. - history = region.Get(baKey) as AccountHistory; - if (history != null) - { - Console.WriteLine("Found AccountHistory in the cache."); - history.ShowAccountHistory(); - } - // Close the cache. - cache.Close(); - } - } - - //Example 5.12 Using ICacheLoader to Load New Integers in the Region - class ExampleLoaderCallback : ICacheLoader - { - #region Private members - private int m_loads = 0; - #endregion - #region Public accessors - public int Loads - { - get - { - return m_loads; - } - } - #endregion - } -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/data-serialization-apis.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/data-serialization-apis.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/data-serialization-apis.html.md.erb deleted file mode 100644 index d509b21..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/data-serialization-apis.html.md.erb +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Data Serialization APIs ---- - -Use either `IPdxSerializable` or `IGFSerializable` for each region. Do not mix the two. - -For more information on these options, see [Data Serialization](dotnet-data-serialization.html#concept_28A7797A0342447ABF6A5014E0DCB05F). - -- **IPdxSerializable interface**. Provides a flexible way to serialize your domain objects for cache storage and transfer to the servers. This is a Geode built-in serialization framework. See [Data Serialization](dotnet-data-serialization.html#concept_28A7797A0342447ABF6A5014E0DCB05F). -- **IPdxReader**. Supplies operations for reading data from Geode IPDXSerializable types. -- **IPdxWriter**. Provides operations for writing data into Geode IPDXSerializable types. -- **IPdxInstance**. Instance of a PDX serialized object that you can use to access the object’s data without having to deserialize the object first. -- **IPdxInstanceFactory**. Allows you to build an IPdxInstance using raw data. -- **IPdxTypeMapper interface**. Allows you to map .NET type names to Java type names when using PDX serialization. -- **IGFSerializable interface**. Superclass of one set of user objects that can be serialized and stored in the cache. These are Geode built-in serializable types. See [Data Serialization](dotnet-data-serialization.html#concept_28A7797A0342447ABF6A5014E0DCB05F). -- **Serializable class**. Wraps the native C++ `gemfire::Serializable` objects as managed `IGFSerializable` objects. Whenever native C++ clients and .NET clients interoperate and are part of the same distributed system, the user-defined types that are put by the native C++ clients that have not been defined in .NET are returned as objects of this class. - - The API contains overloads for most Region methods and other methods that take `Serializable` as a value and that are more optimized than the more generic `IGFSerializable` overloads. The application prefers using these overloads whenever the base class of an object is `Serializable`. - -- **DataInput**. Supplies operations for reading primitive data values and user-defined objects from a byte stream. -- **DataOutput**. Provides operations for writing primitive data values and user-defined objects implementing `IGFSerializable` to an integer. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-accessing-an-entry.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-accessing-an-entry.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-accessing-an-entry.html.md.erb deleted file mode 100644 index 7ba4a4a..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-accessing-an-entry.html.md.erb +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Accessing an Entry ---- - -The region entry retrieval methods return the value associated with the specified key, and pass the callback argument to any cache loaders or cache writers that are invoked during the operation. - -If the value is not available locally, it is requested from the server. If the server request is unsuccessful, a local cache loader is invoked, if one is available. The operation throws `keyNotFoundException` if the `Region` is unable to retrieve a value through any of these means. - -## Using the Region API to Retrieve Values From the Cache - -Here, the program retrieves two entries from the region. - -``` pre -string value1 = region1["Key1"]; -string value2 = region1["Key2"]; - -int valueA = region2["KeyA"]; -int valueB = region2["KeyB"]; - -string valueQ = region.Get(111, null); -string valueR = region.Get(222, null); -``` - -## Batch Operations—Using getAll to Return Values from Multiple Entries - -The `GetAll` region API returns values for collection of keys from the local cache or server. - -If value for a key is not present locally, then it is requested from the Java server. The value returned is not copied, so multi-threaded applications should not modify the value directly but should use the update methods. - -This method is not applicable to local region instances. - -This operation updates the `CacheStatistics.LastAccessedTime`, `CacheStatistics.HitCount` statistics and `CacheStatistics.MissCount` for this region and the returned entries. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-adding-entry-to-cache.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-adding-entry-to-cache.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-adding-entry-to-cache.html.md.erb deleted file mode 100644 index f633e56..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-adding-entry-to-cache.html.md.erb +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Adding an Entry to the Cache ---- - -You populate a native client region with cache entries by using the generic `IDictionary` API or by using the .NET `Region.Put` or the `Region.Create` API functions. - -The `Put` function places a new value into a region entry with the specified key, while the `Create` function creates a new entry in the region. The `Put` and `Create` functions provide a user-defined parameter object to any cache writer invoked in the process. - -If a value for the entry key already exists in the cache when you add an entry, Geode overwrites the previously cached value. New values in the cache are propagated to the connected cache server. - -The .NET Generics provide type safety, so you cannot change your entry key and value types once you have begun to populate the region. If you need to use different types for the same region, store them all inside objects in the region. - -## Using the API to Put Values Into the Cache - -In this example, the program puts entries into the cache with string values. - -``` pre -region1["Key1"] = "Value1"; -region1["Key2"] = "Value2"; - -region2["KeyA"] = 123; -region2["KeyB"] = 100; -region3.Put(111, "Value1", null); -region3.Put(222, "Value2", null); -``` - -## Batch Operations—Using PutAll to Add Multiple Entries - -You can batch up multiple key/value pairs into a hashmap and put them into the cache with a single operation using the .NET `Region.PutAll` API function. Each entry is processed for interest registration on the server, so each entry requires its own unique event ID. Updates and creates can be mixed in a `PutAll` operation, so those events need to be addressed on the cache server for appropriate cache listener invocation on distributed system members. Map entries retain their original order when they are processed at the server. http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-application-domains.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-application-domains.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-application-domains.html.md.erb deleted file mode 100644 index def4234..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-application-domains.html.md.erb +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: .NET Application Domains ---- - -Application domains, or `AppDomain`s, are units of isolation, security boundaries, and loading and unloading for applications in the .NET runtime. Multiple application domains can run in a single process. Each can have one or many threads, and a thread can switch application domains at runtime. - -**Note:** -Before you use application domains with Geode, make sure you understand how to use them generally in your .NET programming. - -The .NET managed assemblies require interface methods invoked by the native C++ layer to be in the same `AppDomain` as that of the .NET DLL. If not, an exception is thrown because the thread is unable to cross `AppDomain` boundaries. - -- **[Problem Scenarios](../../nativeclient/dotnet-caching-api/problem-scenarios.html)** - - These scenarios describe processes and implementations that should be avoided when using `AppDomains`. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-caching-api.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-caching-api.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-caching-api.html.md.erb deleted file mode 100644 index e0c73d9..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-caching-api.html.md.erb +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Working with the .NET API ---- - -This section describes the primary classes, usage conventions, and C++ to .NET class mappings of the native client .NET API. It demonstrates how to use the API to create caches and perform data serialization. - -- **[About the Native Client .NET API](../../nativeclient/dotnet-caching-api/csharp-dotnet-api.html)** - - The Microsoft .NET Framework interface for the Apache Geode native client provides complete access to the native client C++ functionality from any .NET Framework language (C\#, C++/CLI, VB.NET, and J\#). This enables clients using C\# and other .NET languages to use the capabilities provided by the Geode C++ API. - -- **[C++ Class to .NET Class Mappings](../../nativeclient/dotnet-caching-api/cpp-class-to-dotnet-class-mappings.html)** - - Wherever the native C++ class methods use pass-by-reference semantics to return data, the corresponding .NET methods return the object instead of using pass-by-reference semantics. - -- **[Java to .NET Type Mapping Table](../../nativeclient/dotnet-caching-api/java-to-dotnet-type-mapping.html)** - - The following table provides a mapping between Java and .NET types. - -- **[Object Lifetimes](../../nativeclient/dotnet-caching-api/object-lifetimes.html)** - - The .NET API provides a managed set of assemblies for the C++ API. The underlying C++ object will stay in memory until the .NET object is garbage-collected. - -- **[.NET Application Domains](../../nativeclient/dotnet-caching-api/dotnet-application-domains.html)** - - Application domains, or `AppDomain`s, are units of isolation, security boundaries, and loading and unloading for applications in the .NET runtime. Multiple application domains can run in a single process. Each can have one or many threads, and a thread can switch application domains at runtime. - -- **[Creating a Cache](../../nativeclient/dotnet-caching-api/creating-a-cache.html)** - - You create a cache using the Geode `CacheFactory.Create` call. Cache creation initializes the distributed system and creates the cache using your `gfcpp.properties` and `cache.xml` file settings and any additional properties you provide to the call. - -- **[Creating a Region](../../nativeclient/dotnet-caching-api/creating-a-region.html)** - - To create a region, you create a `RegionFactory` using the `RegionShortcut` that most closely fits your region configuration. - -- **[Adding an Entry to the Cache](../../nativeclient/dotnet-caching-api/dotnet-adding-entry-to-cache.html)** - - You populate a native client region with cache entries by using the generic `IDictionary` API or by using the .NET `Region.Put` or the `Region.Create` API functions. - -- **[Accessing an Entry](../../nativeclient/dotnet-caching-api/dotnet-accessing-an-entry.html)** - - The region entry retrieval methods return the value associated with the specified key, and pass the callback argument to any cache loaders or cache writers that are invoked during the operation. - -- **[Removing an Entry](../../nativeclient/dotnet-caching-api/removing-entry.html)** - - The standard `Region::Remove` API removes the entry with specified key and provides a user-defined parameter object to any `CacheWriter` or `CacheListener` invoked in the process. - -- **[Data Serialization](../../nativeclient/dotnet-caching-api/dotnet-data-serialization.html)** - - All data that Geode moves out of the local cache must be serializable. - -- **[Application Callbacks](../../nativeclient/dotnet-caching-api/application-callbacks.html)** - - For region-level events, an application can use `AttributesFactory.SetCache*` methods to implement and register the `ICacheLoader`, `ICacheWriter`, and `ICacheListener` interfaces to perform custom actions. - -- **[A Simple C\# Example](../../nativeclient/dotnet-caching-api/simple-csharp-example.html)** - - An example shows how to connect to Geode, create a cache and region, put and get keys and values, and disconnect. - -- **[Troubleshooting .NET Applications](../../nativeclient/dotnet-caching-api/troubleshooting-dotnet-applications.html)** - - The .NET Framework does not find managed DLLs using the conventional `PATH` environment variable. In order for your assembly to find and load a managed DLL, it must either be loaded as a private assembly using `assemblyBinding`, or it must be installed into the Global Assembly Cache (GAC). - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization-options.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization-options.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization-options.html.md.erb deleted file mode 100644 index 5b61c62..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization-options.html.md.erb +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Data Serialization Options ---- - -Built-in .NET types are serialized automatically into the cache and can be retrieved by Java servers and other Geode clients. For domain objects that are not simple types, you have three Geode serialization options. - -The options give good performance and flexibility for data storage, transfers, and language types. The Geode options can also improve performance in serializing and deserializing built-in types. - -The simplest option is to use perform automatic serialization by registering the Geode .NET PDX reflection-based autoserializer in your application. When you have this registered, Geode uses it for all domain objects that are not custom serialized. - -You can also custom serialize your objects by implementing one of the Geode .NET interfaces, `GemStone::GemFire::Cache::Generic::IPdxSerializable` or `GemStone::GemFire::Cache::IGFSerializable`. - -You also have the option of using default .NET serialization, but you cannot use it unless you also use helper classes. The helper classes you must use are `CacheableObject` and `CacheableObjectXml`. - -Geode .NET PDX serialization has more bytes in overhead than Geode .NET Data serialization, but using PDX serialization helps you avoid the performance costs of deserialization when performing queries. Applications can use `PdxInstances` in functions to avoid the deserialization of entire objects. - - - - - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1. Serialization Options—Comparison of Features
CapabilityIGFSerializableIPdxSerializable and PDX reflection-based autoserializer

Handles multiple versions of domain objects*

X

Provides single field access on servers of serialized data, without full deserialization. Supported also for OQL queries.

X

Automatically ported to other languages by Geode - no need to program Java-side implementation

X

Works with Geode delta propagation

XX (See explanation below.)
- - -\*You can mix domain object versions where the differences between versions are the addition and removal of object fields. - -By default, you can use Geode delta propagation with PDX serialization. However, delta propagation will not work if you have set the Geode property read-serialized to "true". In terms of deserialization, to apply a change delta propagation requires a domain class instance and the `fromDelta` method. If you have set read-serialized to true, you will receive an `IPdxInstance` instead of a domain class instance and `IPdxInstance` does not have the `fromDelta` method required for delta propagation. You will also require the Java domain class on the server similar to the you would need the .NET PDX Delta domain class. - -For detailed information on the interfaces, see the online API documentation. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization.html.md.erb deleted file mode 100644 index a3429ae..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-data-serialization.html.md.erb +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Data Serialization ---- - -All data that Geode moves out of the local cache must be serializable. - -Region data that must be serializable falls under the following categories: - -- Partitioned regions (except functions that add data locally to a partitioned region use the deserialized form). -- Distributed regions. -- Regions that are persisted or overflowed to disk. -- Server or client regions in a client/server installation. -- Regions distributed between gateways in a multi-site installation. -- Regions that receive events from remote caches. -- Regions that provide function arguments and results. - -To minimize the cost of serialization and deserialization, Geode avoids changing the data format whenever possible. This means your data may be stored in the cache in serialized or deserialized form, depending on how you use it. For example, if a server acts only as a storage location for data distribution between clients, it makes sense to leave the data in serialized form, ready to be transmitted to clients that request it. Partitioned region data is always stored in serialized form with one exception—functions that add data to a partitioned region locally use the deserialized form. - -- **[Data Serialization Options](../../nativeclient/dotnet-caching-api/dotnet-data-serialization-options.html)** - - Built-in .NET types are serialized automatically into the cache and can be retrieved by Java servers and other Geode clients. For domain objects that are not simple types, you have three Geode serialization options. - -- **[Serialize with PDX Serialization](../../nativeclient/dotnet-caching-api/dotnet-pdx-serialization.html)** - - Geode's Portable Data eXchange (PDX) is a cross-language data format that can reduce the cost of distributing and serializing your objects. PDX stores data in named fields that you can access individually, to avoid the cost of deserializing the entire data object. PDX also allows you to mix versions of objects where you have added or removed fields. - -- **[Serialize with the Geode IGFSerializable Interface](../../nativeclient/dotnet-caching-api/serialize-using-igfserializable.html)** - - The .NET `IGFSerializable` interface provides fast and compact data serialization. - -- **[Using a Custom Class With IGFSerializable](../../nativeclient/dotnet-caching-api/custom-class-igfserializable.html)** - - An example shows how to use the `BankAccount` custom key type and the `AccountHistory` value type that were previously defined. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-autoserializer.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-autoserializer.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-autoserializer.html.md.erb deleted file mode 100644 index b6268d6..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-autoserializer.html.md.erb +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: Serialize Using the Geode PDX Autoserializer ---- - -When you register the reflection-based serializer, Geode uses it to serialize all objects that do not implement `IPdxSerializable` or `IGFSerializable`. You can customize the auto-serialization behavior for your domain objects by adding serialization attributes to your object’s fields. - -**Procedure** - -1. If you have not already registered the PDX reflection-based autoserializer, add the registration code to your application. - - For example: - - ``` pre - using GemStone.GemFire.Cache.Generic; - ... - // Register reflection-based autoserializer to serialize - // domain objects using PDX serialization - Serializable.RegisterPdxSerializer(new ReflectionBasedAutoSerializer()); - ``` - - This can only be configured in the application code. It cannot be configured declaratively in `cache.xml`. - -2. (Optional) For each object you intend to have autoserialized, customize the serialization as needed. **Note:** If you also use PDX serialization in Java for the object, customize your serialization the same for both languages. - - 1. The following extension methods apply to autoserialization: - - **WriteTransform**. Controls what field value is written during auto serialization. - - **ReadTransform**. Controls what field value is read during auto deserialization. - - **GetFieldType**. Defines the specific field names that will be generated during autoserialization. - - **IsIdentityField**. Controls which field is marked as the identity field. Identity fields are used when a `PdxInstance` computes its hash code to determine whether it is equal to another object. - - **GetFieldType**. Determines the field type that will be used when autoserializing the given field. - - **IsFieldIncluded**. Specifies which fields of a class to autoserialize. - - See [Extending the Autoserializer](extending-pdx-autoserializer.html#concept_87701FF3FAE74F3193BE3FB349CE0086) for sample usage. - - 2. If you are writing a Java application, you can use the `IPdxType` Mapper to map Java types to .NET types. Note that you only need to use the `IPdxTypeMapper` if you are writing Java applications. - - See [Map .NET Domain Type Names to PDX Type Names with IPdxTypeMapper](mapping-dotnet-domain-type-names.html#concept_63F4164F1AE242A9BA309738F484182D) for sample usage. - - 3. To specify an identifier field in your domain object, add the attribute `PdxIdentityField` to the field. - - For example: - - ``` pre - [PdxIdentityField] private int id; - ``` - - 4. To exclude a field from serialization, add the .NET attribute `NonSerialized` to the field. - - For example: - - ``` pre - [NonSerialized] private int myLocalData; - ``` - -For each domain class Geode serializes using the autoserializer, all fields are considered for serialization except those defined as `static`, `literal` or `readonly` and those you explicitly exclude using the .NET `NonSerialized` attribute. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization-features.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization-features.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization-features.html.md.erb deleted file mode 100644 index 14d27f4..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization-features.html.md.erb +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Geode PDX Serialization Features ---- - -Geode PDX serialization offers several advantages. - -## Application Versioning of PDX Domain Objects - -Domain objects evolve along with your application code. You may create an address object with two address lines, then realize later that a third line is required for some situations. Or you may realize that a particular field is not used and want to get rid of it. - -With PDX, you can use old and new versions of domain objects together in a distributed system if the versions differ by the addition or removal of fields. This compatibility lets you gradually introduce modified code and data into the system, without bringing the system down. - -Geode maintains a central registry of the PDX domain object metadata. Using the registry, Geode preserves fields in each member's cache regardless of whether the member has the field defined. When a member receives an object that has a field registered that the member is not aware of, the member does not access the field, but preserves it and passes it along with the rest of the object to other members. When a member receives an object that is missing one or more fields according to the member's version, Geode assigns the .NET default values for the field types to the missing fields. - -## Portability of PDX Serializable Objects - -When you create an `IPdxSerializable` object, Geode stores the object's type information in a central registry. The information is passed between peers, between clients and servers, and between distributed systems. - -This offers a notable advantage to the .NET client, which shares data with Java cache servers. Clients automatically pass registry information to servers when they store an `IPdxSerializable` object. Clients can run queries and functions against the data in the servers without the servers needing to know anything about the stored objects. One client can store data on the server to be retrieved by another client, with the server never needing to know the object type. This means you can code your .NET clients to manage data using Java servers without having to create Java implementations of your .NET domain objects. - -## Reduced Deserialization of Serialized Objects - -The access methods for `IPdxSerializable` objects allow you to examine specific fields of your domain object without deserializing the entire object. This can reduce serialization and deserialization costs significantly. .NET clients can run queries and execute functions against the objects in the server caches without deserializing the entire object on the server side. The query engine automatically recognizes PDX objects and uses only the fields it needs. - -Clients can execute Java functions on server data that only access parts of the domain objects by using `PdxInstance.` - -Likewise, peers can access just the fields needed from the serialized object, keeping the object stored in the cache in serialized form. http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization.html.md.erb deleted file mode 100644 index 7837071..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/dotnet-pdx-serialization.html.md.erb +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Serialize with PDX Serialization ---- - -Geode's Portable Data eXchange (PDX) is a cross-language data format that can reduce the cost of distributing and serializing your objects. PDX stores data in named fields that you can access individually, to avoid the cost of deserializing the entire data object. PDX also allows you to mix versions of objects where you have added or removed fields. - -PDX serialization is supported by C++ clients. If you have C++ clients that may receive events for a region, you can now use PDX serialization on the region's entries. - -You have two options for Geode PDX serialization when using the .NET caching API. You can program your domain objects using the `IPdxSerializable` interface, or you can use Geode’s reflection-based autoserializer. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/event-handling-apis.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/event-handling-apis.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/event-handling-apis.html.md.erb deleted file mode 100644 index 0aa0b4e..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/event-handling-apis.html.md.erb +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Event Handling APIs ---- - -Code your event handlers to do minimal work before returning control to Geode. - -For example, a listener implementation may hand off the event to a thread pool that processes the event on its thread rather than the listener thread. Exceptions thrown by the listeners are caught by Geode and logged. - -- **RegionEvent class**. Provides information about the event, such as what region the event originated in, whether the event originated in a cache remote to the event handler, and whether the event resulted from a distributed operation. -- **EntryEvent class**. Provides all available information for the `RegionEvent` . It also provides entry-specific information, such as the old and new entry values and whether the event resulted from a load operation. -- **ICacheLoader application callback interface**. Loads data into a region. -- **ICacheWriter application callback interface**. Synchronously handles region and entry events before the events occur. Entry events are `create`, `update`, `invalidate`, and `destroy`. Region events are invalidate and destroy. This class has the ability to abort events. -- **ICacheListener application callback interface**. Asynchronously handles region and entry events. Listeners receive notifications when entries in a region change, or when changes occur to the region attributes themselves. Entry events are `create`, `update`, `invalidate`, and `destroy`. Region events are `invalidate` and `destroy`. Multiple events can cause concurrent invocation of `ICacheListener` methods. If event A occurs before event B, there is no guarantee that their corresponding ICacheListener method invocations will occur in the same order. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/extending-pdx-autoserializer.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/extending-pdx-autoserializer.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/extending-pdx-autoserializer.html.md.erb deleted file mode 100644 index bc1b765..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/extending-pdx-autoserializer.html.md.erb +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: Extend the PDX Autoserializer ---- - -This example code demonstrates how to extend the autoserializer to customize serialization. - -## Extending the Autoserializer - -``` pre -public class AutoSerializerEx : ReflectionBasedAutoSerializer -{ - public override object WriteTransform(FieldInfo fi, Type type, object originalValue) { - if (fi.FieldType.Equals(Type.GetType("System.Guid"))) { - return originalValue.ToString(); - } else if (fi.FieldType.Equals(Type.GetType("System.Decimal"))) { - return originalValue.ToString(); - } else - return base.WriteTransform(fi, type, originalValue); - } - - public override object ReadTransform(FieldInfo fi, Type type, object serializeValue) { - if (fi.FieldType.Equals(Type.GetType("System.Guid"))) { - Guid g = new Guid((string)serializeValue); - return g; - } else if (fi.FieldType.Equals(Type.GetType("System.Decimal"))) { - return Convert.ToDecimal((string)serializeValue); - } else - return base.ReadTransform(fi, type, serializeValue); - } - - public override FieldType GetFieldType(FieldInfo fi, Type type) { - if (fi.FieldType.Equals(Type.GetType("System.Guid")) || - fi.FieldType.Equals(Type.GetType("System.Decimal"))) - return FieldType.STRING; - return base.GetFieldType(fi, type); - } - - public override bool IsIdentityField(FieldInfo fi, Type type) { - if (fi.Name == "_identityField") - return true; - return base.IsIdentityField(fi, type); - } - - public override string GetFieldName(FieldInfo fi, Type type) { - if (fi.Name == "_nameChange") - return fi.Name + "NewName"; - return fi.Name; - } - - public override bool IsFieldIncluded(FieldInfo fi, Type type) - { - if (fi.Name == "_notInclude") - return false; - return base.IsFieldIncluded(fi, type); - } -} -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/how-igfserializable-works.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/how-igfserializable-works.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/how-igfserializable-works.html.md.erb deleted file mode 100644 index 55d7299..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/how-igfserializable-works.html.md.erb +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: How Serialization Works with IGFSerializable ---- - -When your application puts an object into the cache for distribution, Geode serializes the data by taking these steps. - -1. Calls the appropriate `ClassId` function and creates the `TypeId` from it. -2. Writes the `TypeId` for the instance. -3. Invokes the `ToData` function for the instance. - -When your application subsequently receives a byte array, Geode takes the following steps: - -1. Decodes the `TypeId` and creates an object of the designated type, using the registered factory functions. -2. Invokes the `FromData` function with input from the data stream. -3. Decodes the data and then populates the data fields. - -The `TypeId` is an integer of four bytes, which is a combination of `ClassId` integer and `0x27`, which is an indicator of user-defined type. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/implementing-igfserializable.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/implementing-igfserializable.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/implementing-igfserializable.html.md.erb deleted file mode 100644 index 0ae3cd4..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/implementing-igfserializable.html.md.erb +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Implement the IGFSerializable Interface ---- - -To store your own data types in the cache, you implement the Geode `IGFSerializable` interface. - -Examples follow the procedure. - -**Procedure** - -1. Implement the `ToData` function that serializes your data: - - ``` pre - void ToData(DataOutput output) - ``` - - The `ToData` function is responsible for copying all of the data fields for the object to the object stream. The `DataOutput` class represents the output stream and provides methods for writing the primitives in a network byte order. For more about this, see the online API documentation for `DataOutput.` - -2. Implement the `FromData` function that consumes a data input stream and repopulates the data fields for the object: - - ``` pre - void fromData (DataInput& input) - ``` - - The `DataInput` class represents the input stream and provides methods for reading input elements. The `FromData` function must read the elements of the input stream in the same order that they were written by `ToData`. For more about this, see the online API documentation for `DataInput`. - -3. Implement the `ClassId` function to return an integer which is unique for your class (in the set of all of your user-defined classes). - -## Simple BankAccount Class - -This example shows a simple class, `BankAccount`, that encapsulates two `ints`: `customerId` and `accountId`: - -``` pre -public class BankAccount -{ - private int m_customerId; - private int m_accountId; - public int Customer - { - get - { - return m_customerId; - } - } - public int Account - { - get - { - return m_accountId; - } - } - public BankAccount(int customer, int account) - { - m_customerId = customer; - m_accountId = account; - } -} -``` - -## Implementing a Serializable Class - -To make `BankAccount` serializable, you implement the `IGFSerializable` interface as shown in this example: - -``` pre -public class BankAccount : IGFSerializable - { - private int m_customerId; - private int m_accountId; - public int Customer - { - get - { - return m_customerId; - } - } - public int Account - { - get - { - return m_accountId; - } - } - public BankAccount(int customer, int account) - { - m_customerId = customer; - m_accountId = account; - } - // Our TypeFactoryMethod - public static IGFSerializable CreateInstance() - { - return new BankAccount(0, 0); - } - #region IGFSerializable Members - public void ToData(DataOutput output) - { - output.WriteInt32(m_customerId); - output.WriteInt32(m_accountId); - } - public IGFSerializable FromData(DataInput input) - { - m_customerId = input.ReadInt32(); - m_accountId = input.ReadInt32(); - return this; - } - public UInt32 ClassId - { - get - { - return 11; - } - } - public UInt32 ObjectSize - { - get - { - return (UInt32)(sizeof(Int32) + sizeof(Int32)); - } - } -} -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/implementing-shared-assembly.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/implementing-shared-assembly.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/implementing-shared-assembly.html.md.erb deleted file mode 100644 index 733e4f6..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/implementing-shared-assembly.html.md.erb +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Implementing the Shared Assembly ---- - -Follow these steps to install the shared assembly into the Global Assembly Cache (GAC). - -1. Go to the `NativeClient_xxxx` directory. - - ``` pre - cd %GFCPP% - ``` - -2. Run the GAC utility to install `GemStone.GemFire.Cache.dll` into the GAC. - - ``` pre - gacutil.exe /if GemStone.GemFire.Cache.dll - ``` - -When you are ready to uninstall, use the `/u` switch. More information on the GAC utility can be found at [http://www.msdn.com](https://msdn.microsoft.com), or by using `gacutil.exe /?`. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/java-to-dotnet-type-mapping.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/java-to-dotnet-type-mapping.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/java-to-dotnet-type-mapping.html.md.erb deleted file mode 100644 index 3bb303d..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/java-to-dotnet-type-mapping.html.md.erb +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: Java to .NET Type Mapping Table ---- - -The following table provides a mapping between Java and .NET types. - - - - - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1. Java types and .NET types
Java Type.NET Type

instances of PdxSerializable

.NET class of same name

instances of PdxInstance

.NET class of same name

instances serialized by a PdxSerializer

.NET class of same name

java.lang.Byte

System.SByte

java.lang.Boolean

System.Boolean

java.lang.Character

System.Char

java.lang.Short

System.Int16

java.lang.Integer

System.Int32

java.lang.Long

System.Int64

java.lang.Float

System.Float

java.lang.Double

System.Double

java.lang.String

System.String

java.util.Date

System.DateTime

byte[]

System.Byte[]

boolean[]

System.Boolean[]

char[]

System.Char[]

short[]

System.Int16[]

int[]

System.Int32[]

long[]

System.Int64[]

float[]

System.Float[]

double[]

System.Double[]

String[]

System.String[]

byte[][]

System.Byte[][]

Object[]

system.Collections.Generic.List<Object>

java.util.HashMap

System.Collections.Generics.IDictionary<Object, Object>

java.util.Hashtable

System.Collections.Hashtable

java.util.ArrayList

System.Collections.Generic.IList<Object>

java.util.Vector

Collections.ArrayList

java.util.HashSet

CacheableHashSet

java.util.LinkedHashSet

CacheableLinkedHashSet

- - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/mapping-dotnet-domain-type-names.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/mapping-dotnet-domain-type-names.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/mapping-dotnet-domain-type-names.html.md.erb deleted file mode 100644 index 273d19d..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/mapping-dotnet-domain-type-names.html.md.erb +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Map .NET Domain Type Names to PDX Type Names with IPdxTypeMapper ---- - -PDX serialized instances in Java map to .NET types with the same name. If you need to adjust the .NET name, then you need to use the IPdxTypeMapper. - -See the [Java to .NET Type Mapping Table](java-to-dotnet-type-mapping.html#concept_24D0AAC71FF1483AB47A7772DA018966) for current mappings. - -## Using IPdxTypeMapper - -``` pre -//This demonstrates, how to map .NET type to pdx type or java type -public class PdxTypeMapper : IPdxTypeMapper { - - public string ToPdxTypeName(string localTypeName) { - return "pdx_" + localTypeName; - } - - public string FromPdxTypeName(string pdxTypeName) { - return pdxTypeName.Substring(4);//need to extract "pdx_" - } -} -``` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/object-lifetimes.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/object-lifetimes.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/object-lifetimes.html.md.erb deleted file mode 100644 index b3acf2d..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/object-lifetimes.html.md.erb +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Object Lifetimes ---- - -The .NET API provides a managed set of assemblies for the C++ API. The underlying C++ object will stay in memory until the .NET object is garbage-collected. - -The underlying C++ API employs reference counting using smart pointers for most classes. This means that all API operations with those objects return a reference to the underlying object and not a copy. Consequently, the underlying object will not be freed as long as the .NET application holds a reference to an object. In other words, the underlying object will stay in memory until the .NET object is garbage-collected. As long as a reference to an object is alive, the artifacts it maintains will also be alive. - -For example, as long as a `Region` object is not garbage-collected, then the destructor of the C++ native persistence manager (if any) for the region is not invoked. - -In the C++ API, the references to an object are reduced when the object goes out of scope for stack allocation, or is deleted explicitly for heap allocation. The object is destroyed when its reference count reaches zero. In the .NET API, the references are reduced when the object is garbage-collected or is explicitly disposed with the .NET `using` statement. - -Because a reference to the object is returned, any change to the object also immediately changes the object as stored internally. For example, if an object is put into the cache using `Region.Put`, a reference of the object is stored in the internal structures. If you modify the object, the internal object also changes. However, it is not distributed to other members of the distributed system until another `Region.Put` is done. - -To find out if a class is reference counted, look at the online API documentation for the class. If the class is wrapped by `UMWrap` or `SBWrap`, the class is reference counted. - -These are examples of classes that are reference counted: - -- `Cache` -- `CacheStatistics` -- `DistributedSystem` -- `Properties` -- `RegionAttributes` -- `AttributesMutator` -- `RegionEntry` -- `Region` -- `EntryEvent` -- `RegionEvent` - -These are examples of classes that are not reference counted: - -- `AttributesFactory` -- `DataInput` -- `DataOutput` -- `SystemProperties` - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/other-apis.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/other-apis.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/other-apis.html.md.erb deleted file mode 100644 index 89c34e4..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/other-apis.html.md.erb +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Property Collections and Logging APIs ---- - -This section describes classes for property collections and logging. - -- **Properties** **class**. Provides a collection of properties, each of which is a key/value pair. Each key is a string, and the value can be a string or an integer. -- **Log class**. Defines methods available to clients that need to write a log message to their Geode system shared log file. Any attempt to use an instance after its connection is disconnected throws a **NotConnectedException**. For any logged message the log file contains: - - The log level of the message. - - The time the message was logged. - - The ID of the connection and thread that logged the message. - - The message itself, possibly with an exception including its stack trace. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/primary-apis-cache-generic.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/primary-apis-cache-generic.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/primary-apis-cache-generic.html.md.erb deleted file mode 100644 index fa3bbf6..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/primary-apis-cache-generic.html.md.erb +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Primary APIs ---- - -These are the main APIs within `GemStone::GemFire::Cache::Generic` used for cache, region, and data entry management in Geode .NET. For detailed information about the APIs, see the .NET API documentation included in the product or available online. - -**Note:** -Declarative configuration via XML of application plug-ins such as cache listener, cache writer, cache loader and partition resolver is not supported when clients are operated in the new .NET Generic API. - -- **[Cache APIs](../../nativeclient/dotnet-caching-api/cache-apis.html)** - - This section describes the `CacheFactory` and `Cache` classes. - -- **[Region and Entry APIs](../../nativeclient/dotnet-caching-api/region-entry-apis.html)** - - This section describes classes for working with Geode regions and region entries. - -- **[Data Serialization APIs](../../nativeclient/dotnet-caching-api/data-serialization-apis.html)** - - Use either `IPdxSerializable` or `IGFSerializable` for each region. Do not mix the two. - -- **[Event Handling APIs](../../nativeclient/dotnet-caching-api/event-handling-apis.html)** - - Code your event handlers to do minimal work before returning control to Geode. - -- **[Property Collections and Logging APIs](../../nativeclient/dotnet-caching-api/other-apis.html)** - - This section describes classes for property collections and logging. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/private-assembly.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/private-assembly.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/private-assembly.html.md.erb deleted file mode 100644 index e3aa34e..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/private-assembly.html.md.erb +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Using GemStone.GemFire.Cache.dll As a Private Assembly ---- - -To access `GemStone.GemFire.Cache.dll` as a private assembly, you need to specify a `.config` file for your application. - -The file needs to be the same name as your application, with a `.config` suffix. For example, the `.config` file for `main.exe` would be `main.exe.config`. The two files must reside in the same directory. - -Follow these steps to create a `.config` file: - -1. Copy `%GFCPP%/docs/default.exe.config` to the appropriate location. -2. Rename `default.exe.config` to the name of your application. -3. Change the `href` attribute of the `CodeBase` element to point to your `GemStone.GemFire.Cache.dll` file. Any of three path types – http, relative, or absolute – will work. - -## A Sample .config File - -The following example shows an excerpt of a `.config` file. The `PublicKeyToken` value is only an example, and the codebase version value is not set correctly. See `%GFCPP%/docs/default.exe.config` for an actual example for this release. - -``` pre - - - - - - - - - - -``` - -**Note:** -If the `.config` file contain errors, no warning or error messages are issued. The application runs as if no `.config` file is present. - - http://git-wip-us.apache.org/repos/asf/geode-native/blob/de0559be/geode-docs/nativeclient/dotnet-caching-api/problem-scenarios.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/dotnet-caching-api/problem-scenarios.html.md.erb b/geode-docs/nativeclient/dotnet-caching-api/problem-scenarios.html.md.erb deleted file mode 100644 index 4d7c4ec..0000000 --- a/geode-docs/nativeclient/dotnet-caching-api/problem-scenarios.html.md.erb +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Problem Scenarios ---- - -These scenarios describe processes and implementations that should be avoided when using `AppDomains`. - - -## Using Application Callbacks - -**Scenario:** A .NET thread loads the Geode DLL in application domain `AD1`. This thread may have access to the other domains in the application if code access security allows it. This thread can then call `AppDomain.CreateInstance` to create a callback object ( `ICacheListener`, `ICacheLoader`, or `ICacheWriter`) in another domain called `AD2`. If the callback object is marshaled by reference, the callback is executed in the domain where it is created (`AD2`). The thread that loads the Geode DLL in domain `AD1` runs the callback methods in the second domain, `AD2`. An exception is thrown when the callback method is invoked because the native code that invokes the callback is not allowed to cross the `AppDomain` boundary. - -**Resolution:** When an application creates and unloads application domains it should ensure that the application domain where the Geode .NET DLL is loaded is the same domain where the application callback and `IGFSerializable` objects are created. - -## Loading an Application DLL in Multiple AppDomains - -**Scenario:** the application loads the Geode DLL in one application domain, then reloads the Geode DLL in another application domain (with or without unloading the previous `AppDomain` ). The callbacks, as well as other interface implementations, like `IPdxSerializable` and `IGFSerializable`, throw exceptions because the native C++ code does not know about `AppDomains` and is loaded only once in the initial `AppDomain`. - -**Resolution:** The application should always use the first `AppDomain` to load the Geode DLL, or it should not load the Geode DLL multiple times. - -## Native Client inside IIS - -**Scenario:** When you deploy more than one web application inside an Internet Information Service (IIS), the IIS creates an appdomain subprocess for each web application in the single process, but the native client C++ cache instance remains a singleton in the process. Because of this, you can run into conflicts between cache creation and closure by the different appdomains. For example, if one appdomain calls `cache.close`, it closes the cache for the entire process. Any further cache access operations by the other appdomains return cache closed exceptions. - -**Resolution:** `Cache create`/`close` provides reference counting of `Cache` `create` and `close`. Each process can use the counter to make sure it creates the `Cache` once and closes it once. To enable this, set the Geode system property, `appdomain-enabled` to true .