Skip to content

Commit

Permalink
Fix based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brfrn169 committed Dec 3, 2024
1 parent 79d6efa commit 76fc4dc
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions core/src/main/java/com/scalar/db/common/TransactionExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public final class TransactionExecutor {
private static final int DEFAULT_RETRY_MULTIPLIER = 2;
private static final int DEFAULT_RETRY_MAX_RETRIES = 5;

private static int retryInitialIntervalMillis = DEFAULT_RETRY_INITIAL_INTERVAL_MILLIS;
private static int retryMaxIntervalMillis = DEFAULT_RETRY_MAX_INTERVAL_MILLIS;
private static int retryMultiplier = DEFAULT_RETRY_MULTIPLIER;
private static int retryMaxRetries = DEFAULT_RETRY_MAX_RETRIES;

private TransactionExecutor() {}

public static <T> T execute(
Expand Down Expand Up @@ -86,10 +81,10 @@ public static <T> T executeWithRetries(
return executeWithRetries(
transactionManager,
throwableFunction,
retryInitialIntervalMillis,
retryMaxIntervalMillis,
retryMultiplier,
retryMaxRetries);
DEFAULT_RETRY_INITIAL_INTERVAL_MILLIS,
DEFAULT_RETRY_MAX_INTERVAL_MILLIS,
DEFAULT_RETRY_MULTIPLIER,
DEFAULT_RETRY_MAX_RETRIES);
}

public static <T> T executeWithRetries(
Expand Down Expand Up @@ -140,10 +135,10 @@ public static void executeWithRetries(
executeWithRetries(
transactionManager,
throwableConsumer,
retryInitialIntervalMillis,
retryMaxIntervalMillis,
retryMultiplier,
retryMaxRetries);
DEFAULT_RETRY_INITIAL_INTERVAL_MILLIS,
DEFAULT_RETRY_MAX_INTERVAL_MILLIS,
DEFAULT_RETRY_MULTIPLIER,
DEFAULT_RETRY_MAX_RETRIES);
}

public static void executeWithRetries(
Expand All @@ -165,20 +160,4 @@ public static void executeWithRetries(
retryMultiplier,
retryMaxRetries);
}

public static void setRetryInitialIntervalMillis(int retryInitialIntervalMillis) {
TransactionExecutor.retryInitialIntervalMillis = retryInitialIntervalMillis;
}

public static void setRetryMaxIntervalMillis(int retryMaxIntervalMillis) {
TransactionExecutor.retryMaxIntervalMillis = retryMaxIntervalMillis;
}

public static void setRetryMultiplier(int retryMultiplier) {
TransactionExecutor.retryMultiplier = retryMultiplier;
}

public static void setRetryMaxRetries(int retryMaxRetries) {
TransactionExecutor.retryMaxRetries = retryMaxRetries;
}
}

0 comments on commit 76fc4dc

Please sign in to comment.