Merge "RetryHelper.Options: Rename caller to actionName"
diff --git a/java/com/google/gerrit/server/update/RetryHelper.java b/java/com/google/gerrit/server/update/RetryHelper.java
index c3a88f2..9f38156 100644
--- a/java/com/google/gerrit/server/update/RetryHelper.java
+++ b/java/com/google/gerrit/server/update/RetryHelper.java
@@ -87,7 +87,7 @@
@Nullable
abstract Duration timeout();
- abstract Optional<String> caller();
+ abstract Optional<String> actionName();
abstract Optional<Predicate<Throwable>> retryWithTrace();
@@ -99,7 +99,7 @@
public abstract Builder timeout(Duration timeout);
- public abstract Builder caller(String caller);
+ public abstract Builder actionName(String caller);
public abstract Builder retryWithTrace(Predicate<Throwable> exceptionPredicate);
@@ -458,7 +458,7 @@
return true;
}
- String actionName = opts.caller().orElse("N/A");
+ String actionName = opts.actionName().orElse("N/A");
// Exception hooks may identify additional exceptions for retry.
if (exceptionHooks.stream()
@@ -507,7 +507,7 @@
logger.atFine().log("%s was attempted %d times", actionType, listener.getAttemptCount());
metrics.attemptCounts.incrementBy(
actionType,
- opts.caller().orElse("N/A"),
+ opts.actionName().orElse("N/A"),
listener.getCause().map(this::formatCause).orElse("_unknown"),
listener.getAttemptCount() - 1);
}
@@ -557,7 +557,7 @@
if (e instanceof RetryException) {
metrics.timeoutCount.increment(
actionType,
- opts.caller().orElse("N/A"),
+ opts.actionName().orElse("N/A"),
e.getCause() != null ? formatCause(e.getCause()) : "_unknown");
}
if (e.getCause() != null) {
diff --git a/java/com/google/gerrit/server/update/RetryableAction.java b/java/com/google/gerrit/server/update/RetryableAction.java
index 336a238..9a2807a 100644
--- a/java/com/google/gerrit/server/update/RetryableAction.java
+++ b/java/com/google/gerrit/server/update/RetryableAction.java
@@ -67,7 +67,7 @@
this.retryHelper = requireNonNull(retryHelper, "retryHelper");
this.actionType = requireNonNull(actionType, "actionType");
this.action = requireNonNull(action, "action");
- options.caller(requireNonNull(actionName, "actionName"));
+ options.actionName(requireNonNull(actionName, "actionName"));
}
/**