You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/10/06 08:48:39 UTC

[GitHub] [accumulo] keith-turner commented on a diff in pull request #2967: Update the new modify properties API to automatically retry on concurrent modification exception.

keith-turner commented on code in PR #2967:
URL: https://github.com/apache/accumulo/pull/2967#discussion_r988734035


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/NamespaceOperationsImpl.java:
##########
@@ -227,6 +216,34 @@ public void modifyProperties(final String namespace,
     }
   }
 
+  public void modifyProperties(final String namespace,
+      final Consumer<Map<String,String>> mapMutator)
+      throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException {
+    EXISTING_NAMESPACE_NAME.validate(namespace);
+    checkArgument(mapMutator != null, "mapMutator is null");
+
+    Retry retry =
+        Retry.builder().infiniteRetries().retryAfter(25, MILLISECONDS).incrementBy(25, MILLISECONDS)
+            .maxWait(30, SECONDS).backOffFactor(1.5).logInterval(3, MINUTES).createRetry();
+
+    while (true) {
+      try {
+        tryToModifyProperties(namespace, mapMutator);
+        break;
+      } catch (ConcurrentModificationException cme) {
+        try {
+          retry.logRetry(log, "Unable to modify namespace properties for " + namespace

Review Comment:
   I made a top level comment about this.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

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