This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push:
new afed77365e Use Duration instead of long+TimeUnit in
ReadOnlyTStore.unreserve (#4371) (#4608)
afed77365e is described below
commit afed77365edf5c4dc60a7bcbfbf80f1c3f6f500f
Author: Dave Marion <[email protected]>
AuthorDate: Tue May 28 16:38:02 2024 -0400
Use Duration instead of long+TimeUnit in ReadOnlyTStore.unreserve (#4371)
(#4608)
---
.../accumulo/core/fate/AbstractFateStore.java | 10 ++++----
.../org/apache/accumulo/core/fate/AdminUtil.java | 6 ++---
.../java/org/apache/accumulo/core/fate/Fate.java | 15 ++++++------
.../org/apache/accumulo/core/fate/FateCleaner.java | 3 +--
.../org/apache/accumulo/core/fate/FateStore.java | 6 ++---
.../accumulo/core/fate/WrappedFateTxStore.java | 6 ++---
.../apache/accumulo/core/fate/FateCleanerTest.java | 21 ++++++++---------
.../org/apache/accumulo/core/fate/TestStore.java | 8 ++-----
.../test/compaction/ExternalCompaction_1_IT.java | 6 ++---
.../accumulo/test/fate/FateInterleavingIT.java | 6 +++--
.../org/apache/accumulo/test/fate/FateStoreIT.java | 27 +++++++++++-----------
11 files changed, 54 insertions(+), 60 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java
b/core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java
index 5c7127c3e7..31b07ef819 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/AbstractFateStore.java
@@ -36,7 +36,6 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
@@ -395,10 +394,9 @@ public abstract class AbstractFateStore<T> implements
FateStore<T> {
}
@Override
- public void unreserve(long deferTime, TimeUnit timeUnit) {
- Duration deferDuration = Duration.of(deferTime, timeUnit.toChronoUnit());
+ public void unreserve(Duration deferTime) {
- if (deferDuration.isNegative()) {
+ if (deferTime.isNegative()) {
throw new IllegalArgumentException("deferTime < 0 : " + deferTime);
}
@@ -414,7 +412,7 @@ public abstract class AbstractFateStore<T> implements
FateStore<T> {
// and clear the map and set the flag. This will cause the next
execution
// of runnable to process all the transactions and to not defer as we
// have a large backlog and want to make progress
- if (deferDuration.compareTo(Duration.ZERO) > 0 &&
!deferredOverflow.get()) {
+ if (deferTime.compareTo(Duration.ZERO) > 0 && !deferredOverflow.get())
{
if (deferred.size() >= maxDeferred) {
log.info(
"Deferred map overflowed with size {}, clearing and setting
deferredOverflow to true",
@@ -422,7 +420,7 @@ public abstract class AbstractFateStore<T> implements
FateStore<T> {
deferredOverflow.set(true);
deferred.clear();
} else {
- deferred.put(fateId, NanoTime.nowPlus(deferDuration));
+ deferred.put(fateId, NanoTime.nowPlus(deferTime));
}
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
b/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
index bea7d3518c..516daef480 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
@@ -20,6 +20,7 @@ package org.apache.accumulo.core.fate;
import static java.nio.charset.StandardCharsets.UTF_8;
+import java.time.Duration;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
@@ -32,7 +33,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
import org.apache.accumulo.core.fate.FateStore.FateTxStore;
@@ -482,7 +482,7 @@ public class AdminUtil<T> {
break;
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
return state;
}
@@ -532,7 +532,7 @@ public class AdminUtil<T> {
break;
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
return state;
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
b/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
index e66287d704..6a08275003 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/Fate.java
@@ -31,6 +31,7 @@ import static
org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus.SUCCESSFUL
import static org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus.UNKNOWN;
import static org.apache.accumulo.core.util.ShutdownUtil.isIOException;
+import java.time.Duration;
import java.util.EnumSet;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
@@ -190,7 +191,7 @@ public class Fate<T> {
runnerLog.error("Uncaught exception in FATE runner thread.", e);
} finally {
if (txStore != null) {
- txStore.unreserve(state.deferTime, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ofMillis(state.deferTime));
}
}
}
@@ -371,7 +372,7 @@ public class Fate<T> {
Preconditions.checkState(txStore.getStatus() == NEW);
seedTransaction(txName, fateId, repo, autoCleanUp, goalMessage,
txStore);
} finally {
- txStore.unreserve(0, MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
return fateId;
});
@@ -408,7 +409,7 @@ public class Fate<T> {
seedTransaction(txName, fateId, repo, autoCleanUp, goalMessage,
txStore);
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -445,7 +446,7 @@ public class Fate<T> {
return false;
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
} else {
// reserved, lets retry.
@@ -475,7 +476,7 @@ public class Fate<T> {
break;
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -488,7 +489,7 @@ public class Fate<T> {
}
return (String) txStore.getTransactionInfo(TxInfo.RETURN_VALUE);
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -502,7 +503,7 @@ public class Fate<T> {
}
return (Exception) txStore.getTransactionInfo(TxInfo.EXCEPTION);
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/FateCleaner.java
b/core/src/main/java/org/apache/accumulo/core/fate/FateCleaner.java
index 4c9e7c0748..e1738c2167 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/FateCleaner.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/FateCleaner.java
@@ -21,7 +21,6 @@ package org.apache.accumulo.core.fate;
import java.time.Duration;
import java.util.EnumSet;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.fate.FateStore.FateTxStore;
import org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus;
@@ -122,7 +121,7 @@ public class FateCleaner<T> {
log.debug("Aged off FATE tx {}", idStatus.getFateId());
}
} finally {
- txStore.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}));
}
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/FateStore.java
b/core/src/main/java/org/apache/accumulo/core/fate/FateStore.java
index 088e502522..9aa7dcbbc4 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/FateStore.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/FateStore.java
@@ -19,8 +19,8 @@
package org.apache.accumulo.core.fate;
import java.io.Serializable;
+import java.time.Duration;
import java.util.Optional;
-import java.util.concurrent.TimeUnit;
/**
* Transaction Store: a place to save transactions
@@ -100,11 +100,11 @@ public interface FateStore<T> extends
ReadOnlyFateStore<T> {
* upon successful return the store now controls the referenced
transaction id. caller should no
* longer interact with it.
*
- * @param deferTime time in millis to keep this transaction from being
returned by
+ * @param deferTime time to keep this transaction from being returned by
* {@link #runnable(java.util.concurrent.atomic.AtomicBoolean,
java.util.function.Consumer)}.
* Must be non-negative.
*/
- void unreserve(long deferTime, TimeUnit timeUnit);
+ void unreserve(Duration deferTime);
}
/**
diff --git
a/core/src/main/java/org/apache/accumulo/core/fate/WrappedFateTxStore.java
b/core/src/main/java/org/apache/accumulo/core/fate/WrappedFateTxStore.java
index 031a3ece02..ac5147d4a9 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/WrappedFateTxStore.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/WrappedFateTxStore.java
@@ -19,10 +19,10 @@
package org.apache.accumulo.core.fate;
import java.io.Serializable;
+import java.time.Duration;
import java.util.EnumSet;
import java.util.List;
import java.util.Optional;
-import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus;
import org.apache.accumulo.core.util.Pair;
@@ -35,8 +35,8 @@ public class WrappedFateTxStore<T> implements
FateStore.FateTxStore<T> {
}
@Override
- public void unreserve(long deferTime, TimeUnit timeUnit) {
- wrapped.unreserve(deferTime, timeUnit);
+ public void unreserve(Duration deferTime) {
+ wrapped.unreserve(deferTime);
}
@Override
diff --git
a/core/src/test/java/org/apache/accumulo/core/fate/FateCleanerTest.java
b/core/src/test/java/org/apache/accumulo/core/fate/FateCleanerTest.java
index 1a5a4fb708..eb0d1dc748 100644
--- a/core/src/test/java/org/apache/accumulo/core/fate/FateCleanerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/fate/FateCleanerTest.java
@@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import java.time.Duration;
import java.util.Set;
-import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.fate.FateCleaner.TimeSource;
import org.apache.accumulo.core.fate.ReadOnlyFateStore.FateIdStatus;
@@ -55,7 +54,7 @@ public class FateCleanerTest {
FateId fateId1 = testStore.create();
var txStore1 = testStore.reserve(fateId1);
txStore1.setStatus(TStatus.IN_PROGRESS);
- txStore1.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore1.unreserve(Duration.ZERO);
cleaner.ageOff();
@@ -63,7 +62,7 @@ public class FateCleanerTest {
var txStore2 = testStore.reserve(fateId2);
txStore2.setStatus(TStatus.IN_PROGRESS);
txStore2.setStatus(TStatus.FAILED);
- txStore2.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore2.unreserve(Duration.ZERO);
cleaner.ageOff();
@@ -73,7 +72,7 @@ public class FateCleanerTest {
var txStore3 = testStore.reserve(fateId3);
txStore3.setStatus(TStatus.IN_PROGRESS);
txStore3.setStatus(TStatus.SUCCESSFUL);
- txStore3.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore3.unreserve(Duration.ZERO);
cleaner.ageOff();
@@ -107,19 +106,19 @@ public class FateCleanerTest {
FateId fateId1 = testStore.create();
var txStore1 = testStore.reserve(fateId1);
txStore1.setStatus(TStatus.IN_PROGRESS);
- txStore1.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore1.unreserve(Duration.ZERO);
FateId fateId2 = testStore.create();
var txStore2 = testStore.reserve(fateId2);
txStore2.setStatus(TStatus.IN_PROGRESS);
txStore2.setStatus(TStatus.FAILED);
- txStore2.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore2.unreserve(Duration.ZERO);
FateId fateId3 = testStore.create();
var txStore3 = testStore.reserve(fateId3);
txStore3.setStatus(TStatus.IN_PROGRESS);
txStore3.setStatus(TStatus.SUCCESSFUL);
- txStore3.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore3.unreserve(Duration.ZERO);
FateId fateId4 = testStore.create();
@@ -142,7 +141,7 @@ public class FateCleanerTest {
txStore1 = testStore.reserve(fateId1);
txStore1.setStatus(TStatus.FAILED_IN_PROGRESS);
- txStore1.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore1.unreserve(Duration.ZERO);
tts.time = 30;
@@ -152,7 +151,7 @@ public class FateCleanerTest {
txStore1 = testStore.reserve(fateId1);
txStore1.setStatus(TStatus.FAILED);
- txStore1.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore1.unreserve(Duration.ZERO);
cleaner.ageOff();
@@ -184,7 +183,7 @@ public class FateCleanerTest {
var txStore2 = testStore.reserve(fateId2);
txStore2.setStatus(TStatus.IN_PROGRESS);
txStore2.setStatus(TStatus.FAILED);
- txStore2.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore2.unreserve(Duration.ZERO);
// create another in the NEW state
FateId fateId3 = testStore.create();
@@ -204,7 +203,7 @@ public class FateCleanerTest {
var txStore1 = testStore.reserve(fateId1);
txStore1.setStatus(TStatus.IN_PROGRESS);
txStore1.setStatus(TStatus.FAILED);
- txStore1.unreserve(0, TimeUnit.MILLISECONDS);
+ txStore1.unreserve(Duration.ZERO);
// advance time by 2 hours, both should be able to age off.. however the
status changed on txid1
// so it should not age off
diff --git a/core/src/test/java/org/apache/accumulo/core/fate/TestStore.java
b/core/src/test/java/org/apache/accumulo/core/fate/TestStore.java
index 1098a44c26..bfe9251189 100644
--- a/core/src/test/java/org/apache/accumulo/core/fate/TestStore.java
+++ b/core/src/test/java/org/apache/accumulo/core/fate/TestStore.java
@@ -19,6 +19,7 @@
package org.apache.accumulo.core.fate;
import java.io.Serializable;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
@@ -28,15 +29,10 @@ import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import java.util.stream.Stream;
-import org.apache.accumulo.core.fate.FateStore.FateTxStore;
-import org.apache.accumulo.core.fate.ReadOnlyFateStore.FateIdStatus;
-import org.apache.accumulo.core.fate.ReadOnlyFateStore.ReadOnlyFateTxStore;
-import org.apache.accumulo.core.fate.ReadOnlyFateStore.TStatus;
import org.apache.accumulo.core.util.Pair;
/**
@@ -189,7 +185,7 @@ public class TestStore implements FateStore<String> {
}
@Override
- public void unreserve(long deferTime, TimeUnit timeUnit) {
+ public void unreserve(Duration deferTime) {
if (!reserved.remove(fateId)) {
throw new IllegalStateException();
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
index b77b2f59b6..cfd4823f4e 100644
---
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
+++
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
@@ -39,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
@@ -50,7 +51,6 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.accumulo.compactor.ExtCEnv.CompactorIterEnv;
@@ -346,7 +346,7 @@ public class ExternalCompaction_1_IT extends
SharedMiniClusterBase {
FateStore.FateTxStore<Manager> fateTx = fateStore
.createAndReserve(FateKey.forCompactionCommit(allCids.get(tableId).get(0))).orElseThrow();
var fateId = fateTx.getID();
- fateTx.unreserve(0, TimeUnit.MILLISECONDS);
+ fateTx.unreserve(Duration.ZERO);
// Read the tablet metadata
var tabletsMeta =
ctx.getAmple().readTablets().forTable(tableId).build().stream()
@@ -397,7 +397,7 @@ public class ExternalCompaction_1_IT extends
SharedMiniClusterBase {
// remaining external compaction id
var fateTx = fateStore.reserve(fateId);
fateTx.delete();
- fateTx.unreserve(0, TimeUnit.MILLISECONDS);
+ fateTx.unreserve(Duration.ZERO);
// wait for the remaining compaction id to be removed
Wait.waitFor(() -> {
diff --git
a/test/src/main/java/org/apache/accumulo/test/fate/FateInterleavingIT.java
b/test/src/main/java/org/apache/accumulo/test/fate/FateInterleavingIT.java
index 170d64d431..7c46f8a75e 100644
--- a/test/src/main/java/org/apache/accumulo/test/fate/FateInterleavingIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/fate/FateInterleavingIT.java
@@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import java.time.Duration;
import java.util.AbstractMap;
import java.util.Iterator;
import java.util.Map.Entry;
@@ -53,6 +54,7 @@ import org.apache.accumulo.core.fate.FateStore;
import org.apache.accumulo.core.fate.Repo;
import org.apache.accumulo.harness.SharedMiniClusterBase;
import org.apache.accumulo.server.ServerContext;
+import org.apache.accumulo.test.fate.FateTestRunner.TestEnv;
import org.apache.hadoop.io.Text;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
@@ -216,7 +218,7 @@ public abstract class FateInterleavingIT extends
SharedMiniClusterBase
txStore.setTransactionInfo(TxInfo.TX_NAME, "TEST_" + i);
txStore.setStatus(SUBMITTED);
} finally {
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -337,7 +339,7 @@ public abstract class FateInterleavingIT extends
SharedMiniClusterBase
txStore.setTransactionInfo(TxInfo.TX_NAME, "TEST_" + i);
txStore.setStatus(SUBMITTED);
} finally {
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/fate/FateStoreIT.java
b/test/src/main/java/org/apache/accumulo/test/fate/FateStoreIT.java
index f28299b02a..ac1930cf59 100644
--- a/test/src/main/java/org/apache/accumulo/test/fate/FateStoreIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/fate/FateStoreIT.java
@@ -39,7 +39,6 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@@ -189,7 +188,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
FateTxStore<TestEnv> txStore = store.reserve(fateId);
txStore.setStatus(TStatus.SUBMITTED);
assertTrue(txStore.timeCreated() > 0);
- txStore.unreserve(10, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ofSeconds(10));
}
// Verify we have 10 transactions and all are deferred
@@ -219,7 +218,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
transactions.add(fateId);
FateTxStore<TestEnv> txStore = store.reserve(fateId);
txStore.setStatus(TStatus.SUBMITTED);
- txStore.unreserve(30, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ofSeconds(30));
// Verify we have 11 transactions stored and none
// deferred anymore because of the overflow
@@ -242,7 +241,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
// still be false as we are under the limit
assertFalse(store.isDeferredOverflow());
txStore = store.reserve(store.create());
- txStore.unreserve(30, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ofSeconds(30));
assertEquals(1, store.getDeferredCount());
assertFalse(store.isDeferredOverflow());
} finally {
@@ -268,7 +267,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
var fateId = store.create();
var txStore = store.reserve(fateId);
txStore.setStatus(status);
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
expectedStatus.put(fateId, status);
}
}
@@ -287,7 +286,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
var txStore = store.tryReserve(fateIdStatus.getFateId()).orElseThrow();
txStore.setStatus(TStatus.SUCCESSFUL);
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
});
}
}
@@ -323,8 +322,8 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
} finally {
txStore1.delete();
txStore2.delete();
- txStore1.unreserve(0, TimeUnit.SECONDS);
- txStore2.unreserve(0, TimeUnit.SECONDS);
+ txStore1.unreserve(Duration.ZERO);
+ txStore2.unreserve(Duration.ZERO);
}
}
@@ -353,7 +352,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
assertEquals(1, store.list().count());
} finally {
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -381,7 +380,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
} finally {
txStore.setStatus(TStatus.SUCCESSFUL);
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
try {
@@ -391,7 +390,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
assertEquals(TStatus.NEW, txStore.getStatus());
} finally {
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -422,7 +421,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
assertEquals(fateKey1, txStore.getKey().orElseThrow());
} finally {
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -456,7 +455,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
assertEquals(TStatus.NEW, txStore.getStatus());
} finally {
txStore.delete();
- txStore.unreserve(0, TimeUnit.SECONDS);
+ txStore.unreserve(Duration.ZERO);
}
}
@@ -489,7 +488,7 @@ public abstract class FateStoreIT extends
SharedMiniClusterBase implements FateT
for (FateKey fateKey : List.of(fateKey1, fateKey2, fateKey3, fateKey4)) {
var fateTx = store.createAndReserve(fateKey).orElseThrow();
fateKeyIds.put(fateKey, fateTx.getID());
- fateTx.unreserve(0, TimeUnit.MILLISECONDS);
+ fateTx.unreserve(Duration.ZERO);
}
HashSet<FateId> allIds = new HashSet<>();