From 80c3276cee2ffa813da66b2a6b5ae496a16b027a Mon Sep 17 00:00:00 2001 From: patchwork01 <110390516+patchwork01@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:57:04 +0000 Subject: [PATCH] Remove count of commits in SystemTestStateStoreFakeCommits --- .../statestore/SystemTestStateStoreFakeCommits.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/java/system-test/system-test-dsl/src/main/java/sleeper/systemtest/dsl/statestore/SystemTestStateStoreFakeCommits.java b/java/system-test/system-test-dsl/src/main/java/sleeper/systemtest/dsl/statestore/SystemTestStateStoreFakeCommits.java index b1e375d330..02e8cec7ab 100644 --- a/java/system-test/system-test-dsl/src/main/java/sleeper/systemtest/dsl/statestore/SystemTestStateStoreFakeCommits.java +++ b/java/system-test/system-test-dsl/src/main/java/sleeper/systemtest/dsl/statestore/SystemTestStateStoreFakeCommits.java @@ -18,7 +18,6 @@ import sleeper.systemtest.dsl.SystemTestContext; import sleeper.systemtest.dsl.instance.SystemTestInstanceContext; -import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Stream; @@ -26,7 +25,6 @@ public class SystemTestStateStoreFakeCommits { private final SystemTestInstanceContext instance; private final StateStoreCommitterDriver driver; - private final AtomicInteger commitsSent = new AtomicInteger(); public SystemTestStateStoreFakeCommits(SystemTestContext context) { instance = context.instance(); @@ -34,20 +32,15 @@ public SystemTestStateStoreFakeCommits(SystemTestContext context) { } public SystemTestStateStoreFakeCommits sendBatched(Function> buildCommits) { - send(buildCommits.apply(messageFactory())); + driver.sendCommitMessages(buildCommits.apply(messageFactory())); return this; } public SystemTestStateStoreFakeCommits send(Function buildCommit) { - send(Stream.of(buildCommit.apply(messageFactory()))); + driver.sendCommitMessages(Stream.of(buildCommit.apply(messageFactory()))); return this; } - private void send(Stream messages) { - driver.sendCommitMessages(messages - .peek(message -> commitsSent.incrementAndGet())); - } - private StateStoreCommitMessageFactory messageFactory() { return new StateStoreCommitMessageFactory(instance.getTableStatus().getTableUniqueId()); }