From 76fc4dcff2209d5ef07e1744e00067a4abd41e4f Mon Sep 17 00:00:00 2001 From: brfrn169 Date: Tue, 3 Dec 2024 15:12:55 +0900 Subject: [PATCH] Fix based on feedback --- .../scalar/db/common/TransactionExecutor.java | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/core/src/main/java/com/scalar/db/common/TransactionExecutor.java b/core/src/main/java/com/scalar/db/common/TransactionExecutor.java index 10ca431a8..1d687976b 100644 --- a/core/src/main/java/com/scalar/db/common/TransactionExecutor.java +++ b/core/src/main/java/com/scalar/db/common/TransactionExecutor.java @@ -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 execute( @@ -86,10 +81,10 @@ public static 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 executeWithRetries( @@ -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( @@ -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; - } }