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 2020/10/19 21:07:37 UTC

[geode-native] branch support/1.13 updated: GEODE-8593: Update geode-native examples to use builder pattern: C++ (revisions)

This is an automated email from the ASF dual-hosted git repository.

dbarnes pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/support/1.13 by this push:
     new 6b92114  GEODE-8593: Update geode-native examples to use builder pattern: C++ (revisions)
6b92114 is described below

commit 6b92114bf1d43d69ff525857f31c29d8b6ae3032
Author: Dave Barnes <db...@apache.org>
AuthorDate: Mon Oct 19 14:07:23 2020 -0700

    GEODE-8593: Update geode-native examples to use builder pattern: C++ (revisions)
---
 .../connection-pools/client-pool-api.html.md.erb   |  5 +---
 ...onfiguring-pools-attributes-example.html.md.erb | 35 +++++++++++++++++++---
 .../getting-started-nc-client.html.md.erb          |  9 +++---
 3 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/docs/geode-native-docs-cpp/connection-pools/client-pool-api.html.md.erb b/docs/geode-native-docs-cpp/connection-pools/client-pool-api.html.md.erb
index 6bb7047..72e9de3 100644
--- a/docs/geode-native-docs-cpp/connection-pools/client-pool-api.html.md.erb
+++ b/docs/geode-native-docs-cpp/connection-pools/client-pool-api.html.md.erb
@@ -21,10 +21,7 @@ limitations under the License.
 
 The native client API allows your clients to create and manage connection pools. The server side does not have an API.
 
-This section lists the primary native client API for pool management. For complete information on the classes and interfaces described here, see the API documentation.
-
-**Note:**
-Only C\# versions of Pool API interfaces, classes, and methods are shown throughout the text in this section (example: `Pool.GetQueryService()`) . The code examples demonstrate both C++ and C\# versions.
+The primary native client API for pool management is `Apache.Geode.Client.Cache`. For complete information on the classes and interfaces described here, see the API documentation.
 
 **Apache.Geode.Client.Cache**
 
diff --git a/docs/geode-native-docs-cpp/connection-pools/configuring-pools-attributes-example.html.md.erb b/docs/geode-native-docs-cpp/connection-pools/configuring-pools-attributes-example.html.md.erb
index 4696143..1509540 100644
--- a/docs/geode-native-docs-cpp/connection-pools/configuring-pools-attributes-example.html.md.erb
+++ b/docs/geode-native-docs-cpp/connection-pools/configuring-pools-attributes-example.html.md.erb
@@ -19,17 +19,44 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-Connection pools require standard client/server distributed system and cache configuration settings. You must also configure settings for the locator, server, and pool elements.
+Connection pools require a standard client/server distributed system and cache configuration settings. You must also configure settings for the locator, server, and pool elements.
 
 -   Locator. Host and port where a server locator is listening.
 -   Server. Host and port where a server is listening.
 -   Pool. Client/server connection pool.
 
-The example shows a declarative pool configuration. Following the example is a table that describes the attributes that can be configured.
+This page shows examples of creating a pool configuration programmatically using C++ code, and declaratively using XML.
 
-## Example—Declarative Pool Configuration
+## Programmatic Pool Configuration
 
-This example shows a declarative pool configuration.
+This example shows a programmatic pool configuration. For a list of the attributes you can configure, see `PoolFactory` in the API docs.
+
+```cpp
+cache.getPoolManager()
+      .createFactory()
+      .addLocator("localhost", 34756)
+      .setFreeConnectionTimeout(std::chrono::milliseconds(12345))
+      .setLoadConditioningInterval(std::chrono::milliseconds(23456))
+      .setMaxConnections(7)
+      .setMinConnections(3)
+      .setPingInterval(std::chrono::milliseconds(12345))
+      .setReadTimeout(std::chrono::milliseconds(23456))
+      .setRetryAttempts(3)
+      .setServerGroup("ServerGroup1")
+      .setSocketBufferSize(32768)
+      .setStatisticInterval(std::chrono::milliseconds(10123))
+      .setSubscriptionAckInterval(std::chrono::milliseconds(567))
+      .setSubscriptionEnabled(true)
+      .setSubscriptionMessageTrackingTimeout(std::chrono::milliseconds(900123))
+      .setSubscriptionRedundancy(0)
+      .setThreadLocalConnections(true)
+      .create("test_pool_1");
+```
+
+
+## Declarative Pool Configuration
+
+This example shows a declarative pool configuration. Following the example is a table that describes the XML pool attributes you can configure.
 
 **Note:**
 You create an instance of `PoolFactory` through `PoolManager`.
diff --git a/docs/geode-native-docs-cpp/getting-started/getting-started-nc-client.html.md.erb b/docs/geode-native-docs-cpp/getting-started/getting-started-nc-client.html.md.erb
index 9d19505..3a6ca5d 100644
--- a/docs/geode-native-docs-cpp/getting-started/getting-started-nc-client.html.md.erb
+++ b/docs/geode-native-docs-cpp/getting-started/getting-started-nc-client.html.md.erb
@@ -34,16 +34,15 @@ and [Client/Server Configuration](serverman/topologies_and_comm/cs_configuration
 
 To connect to a server, your application must follow these steps:
 
-1. Instantiate a `CacheFactory`, setting characteristics of interest (for example, `log-level`).
-1. Create a cache and use it to instantiate a `PoolFactory`, specifying the hostname and port for the server locator.
-1. Create a named pool of network connections.
+1. Create a cache, setting characteristics of interest (for example, `log-level`).
+1. Use the cache to create a named pool of network connections, specifying the hostname and port for at least one server locator.
 1. Instantiate a region of the desired type (usually PROXY, sometimes CACHING_PROXY) and connect it by name to its counterpart on the server.
 
 Once the connection pool and the shared region are in place, your client application is ready to share data with the server.
 
 **Server Connection: C++ Example**
 
-Create a cache and use it to instantiate a `CacheFactory` and set its characteristics:
+Create a cache and set its characteristics:
 
 ``` cpp
 auto cache = CacheFactory()
@@ -53,7 +52,7 @@ auto cache = CacheFactory()
     .create();
 ```
 
-Create a pool of network connections:
+Use the cache to create a named pool of network connections, specifying the hostname and port for the server locator:
 
 
 ``` cpp