http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/geode-docs/nativeclient/delta-propagation/how-delta-propagation-works.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/delta-propagation/how-delta-propagation-works.html.md.erb b/geode-docs/nativeclient/delta-propagation/how-delta-propagation-works.html.md.erb deleted file mode 100644 index eac1907..0000000 --- a/geode-docs/nativeclient/delta-propagation/how-delta-propagation-works.html.md.erb +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: How Delta Propagation Works ---- - -Geode propagates object deltas using methods that you program on the client side. The methods are in the delta interface, which you implement in your cached objectsâ classes. - -This figure shows delta propagation for a change to an entry with key, `k`, and value object, `v`. - -<a id="how-delta-propagation-works__fig_C4846E7C4C0E4D6097736B5BFBBF93A7"></a> -<span class="figtitleprefix">Figure: </span>Delta Propagation - -<img src="../common/images/delta-propagation.gif" alt="Delta Propagation" id="how-delta-propagation-works__image_69D664D2A4344785A52AC2D492E4B557" class="image" /> - -1. **get operation**. The `get` works as usual; the cache returns the full entry object from the local cache or, if it is unavailable there, from a server cache or from a loader. -2. **update methods**. You need to add code to the objectâs update methods so that they save delta information for object updates, in addition to the work they were already doing. -3. **put operation**. The `put` works as usual in the local cache, using the full value, then calls `hasDelta` to check for deltas and `toDelta` to serialize the information. -4. **receipt of delta**. `fromDelta` extracts the delta information that was serialized by `toDelta` and applies it to the object in the local cache. The delta is applied directly to the existing value or to a clone, depending on how you configure it for the region. -5. **additional distributions**. As with full distributions, receiving members forward the delta according to their configurations and connections to other members. In the example, the server would forward the delta to its peers and its other clients as needed. Receiving members do not recreate the delta; `toDelta` is only called in the originating member. -
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/geode-docs/nativeclient/delta-propagation/implementing-delta-propagation.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/delta-propagation/implementing-delta-propagation.html.md.erb b/geode-docs/nativeclient/delta-propagation/implementing-delta-propagation.html.md.erb deleted file mode 100644 index 6d1c3ee..0000000 --- a/geode-docs/nativeclient/delta-propagation/implementing-delta-propagation.html.md.erb +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: Implementing Delta Propagation ---- - -By default, delta propagation is enabled in your distributed system and is used for objects that implement the delta interface. You program the client-side methods to extract delta information for your entries and to apply received delta information. - -For more information, see [Delta Propagation API](delta-propagation-api.html#delta-propagation-api). - -**Prerequisites** - -- Study your object types and expected application behavior to determine which objects should use delta propagation. Delta propagation is not beneficial for all data and data modification scenarios. See [Exceptions and Limitations](performance.html#performance). -- Decide whether to enable cloning. Cloning is disabled by default. See [cloning-enabled](delta-propagation-properties.html#delta-propagation-properties). -- If you enable cloning, consider providing your own implementation, to optimize performance. -- If you do not enable cloning, be sure to synchronize your delta code. -- If you do not enable cloning, review all associated listener code for dependencies on the entry event old value. Without cloning, Geode modifies the entry in place and so loses its reference to the old value. For delta events, the `EntryEvent` methods to retrieve the old and new values both return the new value. - -**Procedure** - -For every class in which you want delta propagation, implement the delta interface and update your methods to support delta propagation. Exactly how you do this depends on your application and object needs, but these steps describe the basic approach. - -1. Study the object contents to decide how to handle delta changes. - - Delta propagation has the same issues of distributed concurrency control as the distribution of full objects, but on a more detailed level. Some parts of your objects may be able to change independent of one another while others may always need to change together. Send deltas large enough to keep your data logically consistent. If, for example, field A and field B depend on each other, then your delta distributions should either update both fields or neither. As with regular updates, the fewer producers you have on a data region, the lower your likelihood of concurrency issues. - -2. In the application code that puts entries, put the fully populated object into the local cache. This usually means doing a `get` on the entry, unless you are sure it does not already exist anywhere in the distributed region. - - Even though you are planning to send only deltas, errors on the receiving end could cause Geode to request the full object, so you must provide it to the originating put method. Do this even in empty producers, with regions configured for no local data storage. - -3. Change each fieldâs update method to record information about the update. - - The information must be sufficient for `toDelta` to encode the delta and any additional required delta information when it is invoked. - -4. Write `hasDelta` to report on whether a delta is available. -5. When writing your serialization methods, `toDelta`, `fromDelta`, `toData`, `fromData`, be sure to exclude any fields used to manage delta state, which do not need to be sent. -6. Write `toDelta` to create a byte stream with the changes to the object and any other information that `fromDelta` will need to apply the changes. Before returning from `toDelta`, reset your delta state to indicate that there are no delta changes waiting to be sent. -7. Write `fromDelta` to decode the byte stream that `toDelta` creates and update the object. -8. Make sure you provide adequate synchronization to your object to maintain a consistent object state. - - If you do not use cloning, you will probably need to synchronize on reads and writes to avoid reading partially written updates from the cache. This might involve `toDelta`, `fromDelta`, and other object access and update methods. Additionally, your implementation should take into account the possibility of concurrent invocations of `fromDelta` and one or more of the object's update methods. - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/geode-docs/nativeclient/delta-propagation/performance.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/nativeclient/delta-propagation/performance.html.md.erb b/geode-docs/nativeclient/delta-propagation/performance.html.md.erb deleted file mode 100644 index 435997e..0000000 --- a/geode-docs/nativeclient/delta-propagation/performance.html.md.erb +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: Exceptions and Limitations ---- - -In some application scenarios, delta propagation does not show any significant performance benefits. On occasion it results in degradation. There are other limitations and exceptions related to delta propagation. - -## <a id="performance__section_26DE70BF948F4B55A36A7B91C9AE2751" class="no-quick-link"></a>Errors in Delta Propagation - -Errors in delta propagation fall into two categories based on how they are handled: - -- **Problems applying the delta that can be remedied if the originating member sends the full value in place of the delta.** Your put operation does not see errors or exceptions related to the failed delta propagation. The system automatically does a full value distribution to the receiver where the problem occurs. This type of error includes: - - - Unavailable entry value in the receiving cache, either because the entry is missing or its value is null. In both cases, there is nothing to apply the delta to and the full value must be sent. This is most likely to occur if you destroy or invalidate your entries locally, either through application calls or through configured actions like eviction or entry expiration. - - `InvalidDeltaException` thrown by `fromDelta` method, programmed by you. This exception enables you to avoid applying deltas that would violate data consistency checks or other application requirements. Throwing this exception causes Geode to send the full value. - - Any error applying the delta in a client in server-to-client propagation. The client retrieves the full value from the server. -- **Problems creating or distributing the delta that cannot be fixed by distributing the full value.** These problems are caused by errors or exceptions in `hasDelta` or `toDelta`. In these cases, your `put` operation fails with an exception. - -## <a id="performance__section_39CE903E2C0C412E891C420C59AB4588" class="no-quick-link"></a>Performance Limitations - -Consider the following situations in which delta propagation adversely affects performance: - -- **Added costs of deserializing your objects to apply deltas**. Applying a delta requires the entry value to be deserialized. Once this is done, the object is stored back in the cache in deserialized form. This aspect of delta propagation only negatively impacts your system if your objects are not already being deserialized for other reasons, such as for indexing and querying or for listener operations. Once stored in deserialized form, there are reserialization costs for operations that send the object outside of the member, like values sent in response to netSearch or client requests, and storage to disk. The more operations that require reserialization, the higher the overhead of deserializing the object. -- **Cloning**. Cloning can affect performance. Not using cloning is risky, however, as you are modifying cached values in place. Make sure you synchronize your entry access to keep your cache from becoming inconsistent. -- **Problems applying the delta that cause the system to go back to the originator for the full entry value**. In this scenario, the overall operation costs more than sending the full entry value in the first place. The problem can be exacerbated if your delta is sent to a number of recipients, all or most of them request a full value, and the full value send requires the object to be serialized. -- **Disk I/O costs associated with overflow regions**. If you use eviction with overflow to disk, on-disk values must be brought into memory in order to apply the delta. This is much more costly than removing the reference to the disk copy, as you would do with a full value distribution into the cache. - -## <a id="performance__section_F7BC60C9E89B44BBA3D06995D52574AC" class="no-quick-link"></a>Configurations That Require Full Values - -Geode clients can always send deltas to the servers, and servers can usually sent deltas to clients. The following configurations require the servers to send full values to the clients, instead of deltas: - -- When the client's `gemfire.properties` setting `conflate-events` is set to `true`, the servers send full values for all regions. -- When the server region attribute `enable-subscription-conflation` is set to `true` and the client `gemfire.properties` setting `conflate-events` is set to `server`, the servers send full values for the region. -- Servers send full values to client regions that are configured to not cache dataâwith the `PROXY RegionShortcut` in their region attributes `refid`. - -To use the delta propagation feature, all updates on a key in a region must have value types that implement the `Delta` interface. You cannot mix object types for an entry key where some of the types implement delta and some do not. This is because, when a type implementing the delta interface is received for an update, the existing value for the key is cast to a `Delta` type to apply the received delta. - -## <a id="performance__section_2767204E1914425BB8160E4347615B71" class="no-quick-link"></a>General Limitations - -Sometimes `fromDelta` cannot be invoked because there is no object to apply the delta to in the receiving cache. When this happens, the system sends the full value. There are two possible scenarios: - -- If the system can determine beforehand that the receiver does not have a local copy, it sends the initial message with the full value. This is possible when regions are configured with no local data storage, as when you are using them to provide data update information to listeners. -- In less obvious cases, as when an entry has been locally deleted, first the delta is sent, then the receiver requests a full value and that is sent. Whenever the full value is received, any further distributions to the receiverâs peers or clients uses the full value. - -Geode does not propagate deltas for: - -- Transactional commit on the server -- The `putAll` operation - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/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<TKey, TVal> : ICacheLoader<TKey, TVal> -{ - #region ICacheLoader Members - public TVal Load(IRegion<TKey, TVal> 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<TKey, TVal> 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<TKey, TVal> : ICacheWriter<TKey, TVal> -{ - #region ICacheWriter<TKey, TVal> Members - public bool BeforeUpdate(EntryEvent<TKey, TVal> ev) - { - Console.WriteLine("SimpleCacheWriter: Received BeforeUpdate event for: {0}", ev.Key); - return true; - } - // ... handle other entry events as needed - public bool BeforeRegionClear(RegionEvent<TKey, TVal> 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<TKey, TVal> : ICacheListener<TKey, TVal> -{ - #region ICacheListener<TKey, TVal> Members - public void AfterCreate(EntryEvent<TKey, TVal> ev) - { - Console.WriteLine("SimpleCacheListener: Received AfterCreate event - for: {0}", ev.Key); - } - // ... handle other entry events as needed - public void AfterRegionDestroy(RegionEvent<TKey, TVal> 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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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. - -<a id="concept_FD847E19497C4985ACB247C0FA2C2AD5__table_8D8D228E223E4E89A313A17DB5C38652"></a> - -<table> -<caption><span class="tablecap">Table 1. C++ Class to .NET Class Mappings</span></caption> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> -<thead> -<tr class="header"> -<th><p>C++ Class</p></th> -<th><p>.NET Class</p></th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>class <code class="ph codeph">gemfire::AttributesFactory</code></td> -<td>Sealed class <code class="ph codeph">AttributesFactory</code></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::AttributesMutator</code></p></td> -<td>Sealed class <code class="ph codeph">AttributesMutator</code></td> -</tr> -<tr class="odd"> -<td>class <code class="ph codeph">gemfire::Cache</code></td> -<td>Sealed class <code class="ph codeph">Cache</code></td> -</tr> -<tr class="even"> -<td><p>abstract class <code class="ph codeph">gemfire::Cacheable</code></p></td> -<td><p>Interface <code class="ph codeph">IPdxSerializable</code> or interface <code class="ph codeph">IGFSerializable</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::CacheableBytes</code></p></td> -<td><p><code class="ph codeph">Byte[]</code> or <code class="ph codeph">ArrayList<Byte></code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::Cacheableint32</code></p></td> -<td><p><code class="ph codeph">Int32</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::CacheableString</code></p></td> -<td><p><code class="ph codeph">String</code></p></td> -</tr> -<tr class="even"> -<td><p>abstract class <code class="ph codeph">gemfire::CacheableKey</code></p></td> -<td><p>You can use any type that implements <code class="ph codeph">hashcode</code> and <code class="ph codeph">equals</code>. The generic .NET built-in types are all suitable.</p></td> -</tr> -<tr class="odd"> -<td><p>abstract class <code class="ph codeph">gemfire::CacheListener</code></p></td> -<td><p>Interface <code class="ph codeph">ICacheListener</code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::CacheLoader</code></p></td> -<td><p>Interface <code class="ph codeph">ICacheLoader</code> plus static class <code class="ph codeph">CacheLoader</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::CacheWriter</code></p></td> -<td><p>Interface class <code class="ph codeph">ICacheWriter</code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::CacheFactory</code></p></td> -<td><p>Sealed class <code class="ph codeph">CacheFactory</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::DataInput</code></p></td> -<td><p>With <code class="ph codeph">IPdxSerializable</code>, <code class="ph codeph">IPdxReader.</code></p> -<p>With <code class="ph codeph">IGFSerializable</code>, sealed class <code class="ph codeph">DataInput</code>.</p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::DataOutput</code></p></td> -<td><p>With <code class="ph codeph">IPdxSerializable</code>, <code class="ph codeph">IPdxWriter.</code></p> -<p>With <code class="ph codeph">IGFSerializable</code>, sealed class <code class="ph codeph">DataOutput</code> .</p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::DiskPolicyType</code></p></td> -<td><p>enum <code class="ph codeph">DiskPolicyType</code> plus static class <code class="ph codeph">DiskPolicy</code> containing convenience methods for <code class="ph codeph">DiskPolicyType</code> enumeration</p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::DistributedSystem</code></p></td> -<td><p>Sealed class <code class="ph codeph">Distr</code>ibutedSystem</p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::EntryEvent</code></p></td> -<td><p>Sealed class <code class="ph codeph">EntryEvent</code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::Exception</code></p></td> -<td><p>Class <code class="ph codeph">GemfireException</code></p></td> -</tr> -<tr class="odd"> -<td><p>all other exceptions deriving from <code class="ph codeph">gemfire::Exception</code></p></td> - <td><p>Corresponding exceptions deriving from <code class="ph codeph">GemfireException</code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::ExpirationAction</code></p></td> -<td><p>enum <code class="ph codeph">ExpirationAction</code> plus static class <code class="ph codeph">Expiration</code> containing convenience methods for <code class="ph codeph">ExpirationAction</code> enumeration</p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::Log</code></p></td> -<td><p>Static class <code class="ph codeph">Log</code>. The native <code class="ph codeph">Log::log</code> method is mapped to <code class="ph codeph">Log.Write</code> to avoid the conflict with the class name which is reserved for the constructors of Log class. The various loglevel <code class="ph codeph">Throw</code> or <code class="ph codeph">Catch</code> methods are not implemented, since they are redundant to <code class="ph codeph">Log::Log</code> , <code class="ph codeph">Log::LogThrow</code>, and <code class="ph codeph">Log::LogCatch</code> methods that take <code class="ph codeph">LogLevel</code> as a parameter.</p></td> -</tr> -<tr class="even"> -<td><p>enum <code class="ph codeph">gemfire::MemberType</code></p></td> -<td><p>enum <code class="ph codeph">MemberType</code></p></td> -</tr> -<tr class="odd"> -<td><p>abstract class <code class="ph codeph">gemfire::PersistanceManager</code></p></td> -<td><p>Not provided. You can register a C++ implementation using <code class="ph codeph">AttributesFactory.SetPersistenceManager</code> but you cannot implement a new one in .NET</p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::Properties</code></p></td> -<td><p>Sealed class <code class="ph codeph">Properties</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::Properties::Visitor</code></p></td> -<td><p>Delegate <code class="ph codeph">PropertiesVisitor</code></p></td> -</tr> -<tr class="even"> -<td><p>abstract class <code class="ph codeph">gemfire::Region</code></p></td> -<td><p>Class <code class="ph codeph">IRegion</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::RegionAttributes</code></p></td> -<td><p>Sealed class <code class="ph codeph">RegionAttributes</code></p></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::ScopeType</code></p></td> -<td><p>enum <code class="ph codeph">ScopeType</code> plus static class <code class="ph codeph">Scope</code> containing convenience methods for <code class="ph codeph">ScopeType</code> enumeration+</p></td> -</tr> -<tr class="odd"> -<td><p>abstract class <code class="ph codeph">gemfire::Serializable</code></p></td> -<td><p>Two options:</p> -<ul> -<li><p>Interface <code class="ph codeph">IPdxSerializable</code></p></li> -<li><p>Interface <code class="ph codeph">IGFSerializable</code> plus wrapper <code class="ph codeph">Serializable</code> class for native <code class="ph codeph">Serializable</code> and <code class="ph codeph">UserData</code> objects. The native <code class="ph codeph">toString</code> method is not provided, since the <code class="ph codeph">ToString</code> method of the base object class provides the same functionality.</p></li> -</ul></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::SystemProperties</code></p></td> -<td><p>Sealed class <code class="ph codeph">SystemProperties</code></p></td> -</tr> -<tr class="odd"> -<td><p>class <code class="ph codeph">gemfire::UserData</code></p></td> -<td><p>Two options:</p> -<ul> -<li><p>Interface <code class="ph codeph">IPdxSerializable</code></p></li> -<li><p>Interface <code class="ph codeph">IGFSerializable</code></p></li> -</ul></td> -</tr> -<tr class="even"> -<td><p>class <code class="ph codeph">gemfire::VectorT<T></code></p></td> -<td><p>Array of the given type, such as T[]</p></td> -</tr> -</tbody> -</table> - - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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<string, string> region = regionFactory - .Create<string, string>("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<string, string> region = regionFactory - .SetLruEntriesLimit(20000) - .SetInitialCapacity(20000) - .Create<string, string>("exampleRegion"); -``` - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/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 . - -<a id="concept_A97823CFEA20400BBB135AC964746850__fig_D025097BFCEA4D7ABDB173AD6ABE099D"></a> -<span class="figtitleprefix">Figure: </span>C\# .NET Application Accessing the C++ API - -<img src="../common/images/6-DotNet_API-1.gif" id="concept_A97823CFEA20400BBB135AC964746850__image_D91728696A7B4E03A04712EF32C5FBEC" class="image imagecenter" /> - -**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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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<string> m_history; - #endregion - public AccountHistory() - { - m_history = new List<string>(); - } - 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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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); -``` - -## <a id="concept_51D1C2475B394B10868CE6ED8DC5E542__section_8DAEA246DA464BD1B9654827A84A93BF" class="no-quick-link"></a>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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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. - -<a id="concept_6DC3DD288F6C4190AEA07DEDE76DD867__table_D61A94C4BFBE4712835F632F30BB488E"></a> - -<table> -<caption><span class="tablecap">Table 1. Serialization OptionsâComparison of Features</span></caption> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="34%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Capability</th> -<th>IGFSerializable</th> -<th>IPdxSerializable and PDX reflection-based autoserializer</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td><p>Handles multiple versions of domain objects*</p></td> -<td></td> -<td>X</td> -</tr> -<tr class="even"> -<td><p>Provides single field access on servers of serialized data, without full deserialization. Supported also for OQL queries.</p></td> -<td></td> -<td>X</td> -</tr> -<tr class="odd"> -<td><p>Automatically ported to other languages by Geode - no need to program Java-side implementation</p></td> -<td></td> -<td>X</td> -</tr> -<tr class="even"> -<td><p>Works with Geode delta propagation</p></td> -<td>X</td> -<td>X (See explanation below.)</td> -</tr> -</tbody> -</table> - - -\*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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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. - -## <a id="concept_E8DCAA3027B64C0C8213A0DF2D773BF4__section_8F8D96A0DAC3416DA90622D0E240F54A" class="no-quick-link"></a>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. - -## <a id="concept_E8DCAA3027B64C0C8213A0DF2D773BF4__section_4CD0072C619F4F0496B73597B92B2289" class="no-quick-link"></a>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. - -## <a id="concept_E8DCAA3027B64C0C8213A0DF2D773BF4__section_0437E67A0DDE4F92A24658DAB48DD76C" class="no-quick-link"></a>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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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/incubator-geode/blob/381d0faa/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. - -<a id="concept_24D0AAC71FF1483AB47A7772DA018966__table_F85EC7AA1E1140E9888B753E812E65E4"></a> - -<table> -<caption><span class="tablecap">Table 1. Java types and .NET types</span></caption> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Java Type</th> -<th>.NET Type</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td><p>instances of <code class="ph codeph">PdxSerializable</code></p></td> -<td><p>.NET class of same name</p></td> -</tr> -<tr class="even"> -<td><p>instances of <code class="ph codeph">PdxInstance</code></p></td> -<td><p>.NET class of same name</p></td> -</tr> -<tr class="odd"> -<td><p>instances serialized by a <code class="ph codeph">PdxSerializer</code></p></td> -<td><p>.NET class of same name</p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.lang.Byte </code></p></td> -<td><p><code class="ph codeph">System.SByte </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.lang.Boolean </code></p></td> -<td><p><code class="ph codeph">System.Boolean </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.lang.Character </code></p></td> -<td><p><code class="ph codeph">System.Char </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.lang.Short </code></p></td> -<td><p><code class="ph codeph">System.Int16 </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.lang.Integer </code></p></td> -<td><p><code class="ph codeph">System.Int32 </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.lang.Long </code></p></td> -<td><p><code class="ph codeph">System.Int64 </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.lang.Float </code></p></td> -<td><p><code class="ph codeph">System.Float </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.lang.Double </code></p></td> -<td><p><code class="ph codeph">System.Double </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.lang.String </code></p></td> -<td><p><code class="ph codeph">System.String </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.util.Date </code></p></td> -<td><p><code class="ph codeph">System.DateTime </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">byte[] </code></p></td> -<td><p><code class="ph codeph">System.Byte[] </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">boolean[] </code></p></td> -<td><p><code class="ph codeph">System.Boolean[] </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">char[] </code></p></td> -<td><p><code class="ph codeph">System.Char[] </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">short[] </code></p></td> -<td><p><code class="ph codeph">System.Int16[] </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">int[] </code></p></td> -<td><p><code class="ph codeph">System.Int32[] </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">long[] </code></p></td> -<td><p><code class="ph codeph">System.Int64[] </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">float[] </code></p></td> -<td><p><code class="ph codeph">System.Float[] </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">double[] </code></p></td> -<td><p><code class="ph codeph">System.Double[] </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">String[] </code></p></td> -<td><p><code class="ph codeph">System.String[] </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">byte[][] </code></p></td> -<td><p><code class="ph codeph">System.Byte[][] </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">Object[] </code></p></td> -<td><p><code class="ph codeph">system.Collections.Generic.List<Object> </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.util.HashMap </code></p></td> -<td><p><code class="ph codeph">System.Collections.Generics.IDictionary<Object, Object> </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.util.Hashtable </code></p></td> -<td><p><code class="ph codeph">System.Collections.Hashtable </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.util.ArrayList </code></p></td> -<td><p><code class="ph codeph">System.Collections.Generic.IList<Object> </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.util.Vector </code></p></td> -<td><p><code class="ph codeph">Collections.ArrayList </code></p></td> -</tr> -<tr class="odd"> -<td><p><code class="ph codeph">java.util.HashSet </code></p></td> -<td><p><code class="ph codeph">CacheableHashSet </code></p></td> -</tr> -<tr class="even"> -<td><p><code class="ph codeph">java.util.LinkedHashSet </code></p></td> -<td><p><code class="ph codeph">CacheableLinkedHashSet </code></p></td> -</tr> -</tbody> -</table> - - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/381d0faa/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_" - } -} -``` - -