You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by db...@apache.org on 2018/08/09 22:42:06 UTC
[geode-native] branch develop updated: GEODE-5416: Geode Native C#
Example (Put/get domain object using custom DataSerializable) Update
README.md (#329)
This is an automated email from the ASF dual-hosted git repository.
dbarnes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push:
new e11c3bd GEODE-5416: Geode Native C# Example (Put/get domain object using custom DataSerializable) Update README.md (#329)
e11c3bd is described below
commit e11c3bd20e31b220c3a3b244844bad43ceb0cecd
Author: Dave Barnes <db...@pivotal.io>
AuthorDate: Thu Aug 9 15:42:04 2018 -0700
GEODE-5416: Geode Native C# Example (Put/get domain object using custom DataSerializable) Update README.md (#329)
---
examples/dotnet/DataSerializableCs/README.md | 55 +++++++++++++++++++++-------
1 file changed, 42 insertions(+), 13 deletions(-)
diff --git a/examples/dotnet/DataSerializableCs/README.md b/examples/dotnet/DataSerializableCs/README.md
index bbe7ecd..593ebc9 100644
--- a/examples/dotnet/DataSerializableCs/README.md
+++ b/examples/dotnet/DataSerializableCs/README.md
@@ -1,24 +1,53 @@
-# PdxAutoSerializer Example
-This is a simple example showing how to register for auto-serialization of custom objects using the ReflectionBasedAutoSerializer class.
+# DataSerializableCs Example
+This is a simple example showing how to register for serialization of custom objects using the IDataSerializable class.
## Prerequisites
* Install [Apache Geode](https://geode.apache.org)
* Build and install [Apache Geode Native](https://github.com/apache/geode-native)
## Running
-* Start Geode Server and create region.
+* Open a PowerShell window and `cd` to the `DataSerializableCs` example directory
+* Run `startserver.ps1` to start the Geode Server and create a region.
+
```
- gfsh>start locator --name=locator
- gfsh>start server --name=server
- gfsh>create region --name=example_orderobject --type=PARTITION
+ PS C:\> startserver.ps1
+ (1) Executing - start locator --name=locator
+ ...
+ (2) Executing - start server --name=server
+ ...
+ (3) Executing - create region --name=custom_orders --type=PARTITION
+
+ Member | Status
+ ------ | -------------------------------------------
+ server | Region "/custom_orders" created on "server"
+
```
-* Execute `PdxAutoSerializer.exe`.
+* Execute `DataSerializable.exe` to store and retrieve serializable `Order` objects.
- output:
```
- Registering for reflection-based auto serialization
- Storing order object in the region
- order to put is Order: [65, Vox AC30, 11]
- Successfully put order, getting now...
- Order key: 65 = Order: [65, Vox AC30, 11]
+ PS C:\> DataSerializableCs.exe
+ Create orders
+ Storing orders in the region
+ Getting the orders from the region
+ OrderID: 1
+ Product Name: product x
+ Quantity: 23
+ OrderID: 2 Product Name: product y Quantity: 37
+ ```
+* Run `stopserver.ps1` to shut down the server.
+
```
+ PS C:\> stopserver.ps1
+ (1) Executing - connect
+ ...
+ (2) Executing - destroy region --name=custom_orders
+
+ Member | Status
+ ------ | ----------------------------------------------
+ server | Region '/custom_orders' destroyed successfully
+
+ (3) Executing - stop server --name=server
+ ...
+ (4) Executing - stop locator --name=locator
+
+ ```
\ No newline at end of file