You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/01 21:02:49 UTC

[GitHub] [geode] karensmolermiller opened a new pull request #5191: GEODE-8198: Revise docs description of putAll()

karensmolermiller opened a new pull request #5191:
URL: https://github.com/apache/geode/pull/5191


   This PR changes the user guide to go with the Javadocs update that was in GEODE-8171.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] agingade commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
agingade commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r434173604



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket
+and then distributed to the secondary buckets.
+For replicated regions, the keys are sent to one server.
+After applying all entry updates to that server,
+that server distributes the event to the other servers that host the region.
 
-**Example:**
+The design of a client application within a client-server design pattern

Review comment:
       The partial update can happen with non-client pattern (calling putAll in embedded application or in function execution)...In that case the application won't see ServerConnectivity or ServerOperation exception, do we want to call that out... 

##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket

Review comment:
       Its key-value(s) (or entries).

##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket
+and then distributed to the secondary buckets.
+For replicated regions, the keys are sent to one server.
+After applying all entry updates to that server,
+that server distributes the event to the other servers that host the region.
 
-**Example:**
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` is
+thrown,
+it can indicate an incomplete operation.
 
 ``` pre
-void putAll(String command) throws CacheException 
-{ 
-// Get Entry keys and values into Strings key1, ... keyN and value1, ... valueN 
-  Map map = new LinkedHashMap(); 
-  map.put(key1, value1)); 
-  ...
-  map.put(keyN, valueN));
-  this.currRegion.putAll(map); 
+int retry = 0;
+RuntimeException rte = null;
+while (retry < 3) {
+  try {
+    region.putAll(map);
+  } catch (ServerOperationException e) {
+    if (e.getCause() instanceof TimeoutException
+        || e.getCause() instanceof LowMemoryException) {
+      // Retry due to transient error.
+      retry++;
+    } else {
+      rte = e;
+      break;
+    }
+  } catch (ServerConnectivityException e) {
+    // Retry due to transient error.
+    retry++;
+  }
+}
+
+if (retry == 3) {
+  System.out.println("3 putAll operations tried, and all failed.");
+} else if (rte != null) {

Review comment:
       To make the error handling consistent, I modified the sample code. 
   
    public void testPutAll() throws Exception {
       Throwable throwable = null;
       Map map = new LinkedHashMap();
       Region region;
   
       // Retry in case of transient exception.
       for (int retry = 0; retry < 3; retry++) {
         throwable = null;
         try {
           region.putAll(map);
         } catch (ServerOperationException e) {
           throwable = e.getCause();
           if (!(e.getCause() instanceof TimeoutException || e.getCause() instanceof LowMemoryException)) {
             // Non transient exception. Skip retry.
             break;
           }
         } catch (ServerConnectivityException e) {
           throwable = e;
         }
       }
   
       if (throwable != null) {
         // Take appropriate action, like throwing the exception or logging the message.
         System.out.println("putAll failed due to " + throwable);
         throw new Exception(throwable);
       }
     }
   
   I have shown the sample code to Gester and he is fine with this new code.

##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket
+and then distributed to the secondary buckets.
+For replicated regions, the keys are sent to one server.

Review comment:
       Its key-value(s) (or entries).

##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket
+and then distributed to the secondary buckets.
+For replicated regions, the keys are sent to one server.
+After applying all entry updates to that server,

Review comment:
       entry - entries




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433531982



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,
+multiple events are sent as a single message to the primary buckets
+and then distributed to the secondary buckets.
+
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` are
+thrown,
+it can indicate an incomplete operation.
 
 ``` pre
-void putAll(String command) throws CacheException 
-{ 
-// Get Entry keys and values into Strings key1, ... keyN and value1, ... valueN 
-  Map map = new LinkedHashMap(); 
-  map.put(key1, value1)); 
-  ...
-  map.put(keyN, valueN));
-  this.currRegion.putAll(map); 
+int retry = 0;
+RuntimeException rte = null;
+while (retry < 3) {
+  try {
+    region.putAll(map);
+  } catch (ServerOperationException e) {
+    if (e.getCause() instanceof TimeoutException
+        || e.getCause() instanceof LowMemoryException) {
+      // Retry due to transient error.
+      retry++;
+    } else {
+      rte = e;
+      break;
+    }
+  } catch (ServerConnectivityException e) {
+    // Retry due to transient error.
+    retry++;
+  }
+}
+
+if (retry == 3) {
+  System.out.println("3 putAll operations tried, and all failed.");
+} else if (rte != null) {
+  System.out.println("putAll failed due to " + rte);
+  throw rte;
 }
 ```
 
+A thrown exception of `ServerConnectivityException` with a cause of
+`TimeoutException` or `LowMemoryException` can be a transient error.
+A limited quantity of retries of the `putAll` may result in a completed
+operation.
+A repeated timeout may imply that the `read-timeout` value is not
+long enough to complete the bulk operation;
+use the `org.apache.geode.cache.client.PoolFactory.setReadTimeout`
+method to set the `read-timeout` value.
+
+Client applications that cannot tolerate partial completion of a `putAll`
+operation may embed the operation into a transaction.
+See [Transactions](../../developing/transactions/chapter_overview.html)
+for details.
+
+**Note:**
+The processing of a map with many entries and/or extra-large data values

Review comment:
       could also cause LowMemoryException




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] davebarnes97 commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
davebarnes97 commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433511928



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,
+multiple events are sent as a single message to the primary buckets
+and then distributed to the secondary buckets.
+
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` are

Review comment:
       "Either" is singular, so "If either.. is thrown..."




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] karensmolermiller commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
karensmolermiller commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r435430266



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple keys are sent as a single message to each primary bucket
+and then distributed to the secondary buckets.
+For replicated regions, the keys are sent to one server.
+After applying all entry updates to that server,
+that server distributes the event to the other servers that host the region.
 
-**Example:**
+The design of a client application within a client-server design pattern

Review comment:
       I don't want to call that out.  The point of this prose is to clarify what the client app developer needs to know and exceptions that client app needs to catch.  




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433496394



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,

Review comment:
       If you explicitly talking about PR's putAll here, you might have to also have a chapter to talk about DR's putAll. Their behavior are different. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] karensmolermiller commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
karensmolermiller commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r434019791



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,
+multiple events are sent as a single message to the primary buckets
+and then distributed to the secondary buckets.
+
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` are
+thrown,
+it can indicate an incomplete operation.
 
 ``` pre
-void putAll(String command) throws CacheException 
-{ 
-// Get Entry keys and values into Strings key1, ... keyN and value1, ... valueN 
-  Map map = new LinkedHashMap(); 
-  map.put(key1, value1)); 
-  ...
-  map.put(keyN, valueN));
-  this.currRegion.putAll(map); 
+int retry = 0;
+RuntimeException rte = null;
+while (retry < 3) {
+  try {
+    region.putAll(map);
+  } catch (ServerOperationException e) {
+    if (e.getCause() instanceof TimeoutException
+        || e.getCause() instanceof LowMemoryException) {
+      // Retry due to transient error.
+      retry++;
+    } else {
+      rte = e;
+      break;
+    }
+  } catch (ServerConnectivityException e) {
+    // Retry due to transient error.
+    retry++;
+  }
+}
+
+if (retry == 3) {
+  System.out.println("3 putAll operations tried, and all failed.");
+} else if (rte != null) {
+  System.out.println("putAll failed due to " + rte);
+  throw rte;
 }
 ```
 
+A thrown exception of `ServerConnectivityException` with a cause of
+`TimeoutException` or `LowMemoryException` can be a transient error.
+A limited quantity of retries of the `putAll` may result in a completed
+operation.
+A repeated timeout may imply that the `read-timeout` value is not
+long enough to complete the bulk operation;
+use the `org.apache.geode.cache.client.PoolFactory.setReadTimeout`
+method to set the `read-timeout` value.
+
+Client applications that cannot tolerate partial completion of a `putAll`
+operation may embed the operation into a transaction.
+See [Transactions](../../developing/transactions/chapter_overview.html)
+for details.
+
+**Note:**
+The processing of a map with many entries and/or extra-large data values
+may affect system performance and cause cache update timeouts,
+especially if the region uses overflow or persistence to disk.
+
+## <a id="removeAll_method" class="no-quick-link"></a>The removeAll Operation
+
+The batch operation `Region.removeAll`
+
 The updates to the cache are done individually in the order in which they were placed in the `Map`. For partitioned regions, multiple events are sent as a single message to the primary buckets and then distributed to the secondary buckets.
 
 **Note:**
-The processing of maps with very many entries and/or very large data may affect system performance and cause cache update timeouts, especially if the region uses overflow or persistence to disk.
+The processing of a map with many entries and/or extra-large data values

Review comment:
       Purposeful repeat. One of these is for putAll, and the other is for removeAll. Thank for your attention to detail!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] karensmolermiller merged pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
karensmolermiller merged pull request #5191:
URL: https://github.com/apache/geode/pull/5191


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r434157629



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,39 +60,91 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
+For partitioned regions,
+multiple events are sent as a single message to each primary bucket

Review comment:
       should be multiple keys, not multiple events, because there's only one event per putAll. Latter for replicated region, you said "a single event". 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] karensmolermiller commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
karensmolermiller commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433493735



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.

Review comment:
       Nice to know.  That info was already in our docs.  Must've been there and incorrect for a long time!  Is the lack of an ordering guarantee also in effect for the other bulk operations?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433493081



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.

Review comment:
       Actually the order of processing for keys in the map is not guaranteed. But we don't have to mention it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433495799



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.

Review comment:
       Same for removeAll. It depends on what kind of map user is using. For example, if user is using LinkedHashMap, the order of keys will be maintained. But we did not enforce the user to have to use LinkedHashMap. Our API accepts any Map implementation.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] gesterzhou commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433531409



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,
+multiple events are sent as a single message to the primary buckets
+and then distributed to the secondary buckets.
+
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` are
+thrown,
+it can indicate an incomplete operation.
 
 ``` pre
-void putAll(String command) throws CacheException 
-{ 
-// Get Entry keys and values into Strings key1, ... keyN and value1, ... valueN 
-  Map map = new LinkedHashMap(); 
-  map.put(key1, value1)); 
-  ...
-  map.put(keyN, valueN));
-  this.currRegion.putAll(map); 
+int retry = 0;
+RuntimeException rte = null;
+while (retry < 3) {
+  try {
+    region.putAll(map);
+  } catch (ServerOperationException e) {
+    if (e.getCause() instanceof TimeoutException
+        || e.getCause() instanceof LowMemoryException) {
+      // Retry due to transient error.
+      retry++;
+    } else {
+      rte = e;
+      break;
+    }
+  } catch (ServerConnectivityException e) {
+    // Retry due to transient error.
+    retry++;
+  }
+}
+
+if (retry == 3) {
+  System.out.println("3 putAll operations tried, and all failed.");
+} else if (rte != null) {
+  System.out.println("putAll failed due to " + rte);
+  throw rte;
 }
 ```
 
+A thrown exception of `ServerConnectivityException` with a cause of

Review comment:
       Here should be ServerOperationException. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] jchen21 commented on a change in pull request #5191: GEODE-8198: Revise docs description of putAll()

Posted by GitBox <gi...@apache.org>.
jchen21 commented on a change in pull request #5191:
URL: https://github.com/apache/geode/pull/5191#discussion_r433515521



##########
File path: geode-docs/basic_config/data_entries_custom_classes/managing_data_entries.html.md.erb
##########
@@ -60,36 +60,90 @@ You can also use the `gfsh put` command to add entries to a region, and the `get
 
 If you want only to create the entry (with a null value and with method failure if the entry already exists), use `Region.create` instead.
 
-## <a id="managing_data_entries__section_7578349EA26A4621B732FE851D71A84F" class="no-quick-link"></a>Batch Operations (getAll, putAll, removeAll)
+## <a id="getAll_method" class="no-quick-link"></a>The getAll Operation
 
-<%=vars.product_name%> provides three APIs to perform batch operations on multiple region entries:
+The batch operation `Region.getAll`
+takes a collection of keys and returns a `Map` of key-value pairs for
+the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
 
--   `Region.getAll`
--   `Region.putAll`
--   `Region.removeAll`
+## <a id="putAll_method" class="no-quick-link"></a>The putAll Operation
 
-The `getAll` method takes a collection of keys and returns a `Map` of values for the provided keys. If a given key does not exist in the region, then that key's value in the returned map will be null.
+The batch operation `Region.putAll`
+takes a `Map` of key-value pairs, puts them into the cache,
+and distributes them in a single operation.
 
-The `putAll` method takes a `Map` of key-value pairs and puts them into the cache and distributes them in a single operation.
 
-**Example:**
+The updates to the cache are done individually in the order in which
+they were placed in the `Map`.
+For partitioned regions,
+multiple events are sent as a single message to the primary buckets
+and then distributed to the secondary buckets.
+
+The design of a client application within a client-server design pattern
+faces the possibility that a partial operation can occur.
+Some, all, or none of the specified entries may be completed with `putAll`.
+If either `ServerOperationException` or `ServerConnectivityException` are
+thrown,
+it can indicate an incomplete operation.
 
 ``` pre
-void putAll(String command) throws CacheException 
-{ 
-// Get Entry keys and values into Strings key1, ... keyN and value1, ... valueN 
-  Map map = new LinkedHashMap(); 
-  map.put(key1, value1)); 
-  ...
-  map.put(keyN, valueN));
-  this.currRegion.putAll(map); 
+int retry = 0;
+RuntimeException rte = null;
+while (retry < 3) {
+  try {
+    region.putAll(map);
+  } catch (ServerOperationException e) {
+    if (e.getCause() instanceof TimeoutException
+        || e.getCause() instanceof LowMemoryException) {
+      // Retry due to transient error.
+      retry++;
+    } else {
+      rte = e;
+      break;
+    }
+  } catch (ServerConnectivityException e) {
+    // Retry due to transient error.
+    retry++;
+  }
+}
+
+if (retry == 3) {
+  System.out.println("3 putAll operations tried, and all failed.");
+} else if (rte != null) {
+  System.out.println("putAll failed due to " + rte);
+  throw rte;
 }
 ```
 
+A thrown exception of `ServerConnectivityException` with a cause of
+`TimeoutException` or `LowMemoryException` can be a transient error.
+A limited quantity of retries of the `putAll` may result in a completed
+operation.
+A repeated timeout may imply that the `read-timeout` value is not
+long enough to complete the bulk operation;
+use the `org.apache.geode.cache.client.PoolFactory.setReadTimeout`
+method to set the `read-timeout` value.
+
+Client applications that cannot tolerate partial completion of a `putAll`
+operation may embed the operation into a transaction.
+See [Transactions](../../developing/transactions/chapter_overview.html)
+for details.
+
+**Note:**
+The processing of a map with many entries and/or extra-large data values
+may affect system performance and cause cache update timeouts,
+especially if the region uses overflow or persistence to disk.
+
+## <a id="removeAll_method" class="no-quick-link"></a>The removeAll Operation
+
+The batch operation `Region.removeAll`
+
 The updates to the cache are done individually in the order in which they were placed in the `Map`. For partitioned regions, multiple events are sent as a single message to the primary buckets and then distributed to the secondary buckets.
 
 **Note:**
-The processing of maps with very many entries and/or very large data may affect system performance and cause cache update timeouts, especially if the region uses overflow or persistence to disk.
+The processing of a map with many entries and/or extra-large data values

Review comment:
       Line 144-146 looks like duplicate of line 133-135.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org