mirror of
https://github.com/signalapp/Signal-Server
synced 2026-07-13 06:36:28 +01:00
Remove the additional callback executor from FoundationDbMessageStore
This commit is contained in:
committed by
Jon Chambers
parent
292f03586b
commit
4a9302033a
+2
-5
@@ -42,7 +42,6 @@ public class FoundationDbMessageStore {
|
||||
|
||||
private final Database[] databases;
|
||||
private final VersionstampUUIDCipher versionstampUUIDCipher;
|
||||
private final Executor executor;
|
||||
private final Clock clock;
|
||||
|
||||
private static final Subspace MESSAGES_SUBSPACE = new Subspace(Tuple.from("M"));
|
||||
@@ -64,12 +63,10 @@ public class FoundationDbMessageStore {
|
||||
|
||||
public FoundationDbMessageStore(final Database[] databases,
|
||||
final VersionstampUUIDCipher versionstampUUIDCipher,
|
||||
final Executor executor,
|
||||
final Clock clock) {
|
||||
|
||||
this.databases = databases;
|
||||
this.versionstampUUIDCipher = versionstampUUIDCipher;
|
||||
this.executor = executor;
|
||||
this.clock = clock;
|
||||
}
|
||||
|
||||
@@ -243,7 +240,7 @@ public class FoundationDbMessageStore {
|
||||
}));
|
||||
|
||||
return CompletableFuture.allOf(messageInsertFuturesByDeviceId.values().toArray(CompletableFuture[]::new))
|
||||
.thenApplyAsync(_ -> {
|
||||
.thenApply(_ -> {
|
||||
final Map<Byte, Boolean> presenceByDeviceId = messageInsertFuturesByDeviceId.entrySet().stream()
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, entry -> {
|
||||
assert entry.getValue().isDone();
|
||||
@@ -258,7 +255,7 @@ public class FoundationDbMessageStore {
|
||||
}
|
||||
|
||||
return presenceByDeviceId;
|
||||
}, executor);
|
||||
});
|
||||
}
|
||||
|
||||
public MessageStream getMessages(final AciServiceIdentifier aci, final Device destinationDevice) {
|
||||
|
||||
+1
-4
@@ -34,13 +34,13 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.Timeout;
|
||||
@@ -49,7 +49,6 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.junitpioneer.jupiter.cartesian.CartesianTest;
|
||||
import org.whispersystems.textsecuregcm.entities.MessageProtos;
|
||||
import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier;
|
||||
import org.whispersystems.textsecuregcm.storage.Device;
|
||||
@@ -62,7 +61,6 @@ import org.whispersystems.textsecuregcm.util.UUIDUtil;
|
||||
import org.whispersystems.textsecuregcm.util.Util;
|
||||
import reactor.adapter.JdkFlowAdapter;
|
||||
import reactor.test.StepVerifier;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Timeout(value = 5, threadMode = Timeout.ThreadMode.SEPARATE_THREAD)
|
||||
class FoundationDbMessageStoreTest {
|
||||
@@ -85,7 +83,6 @@ class FoundationDbMessageStoreTest {
|
||||
foundationDbMessageStore = new FoundationDbMessageStore(
|
||||
FOUNDATION_DB_EXTENSION.getDatabases(),
|
||||
versionstampUUIDCipher,
|
||||
Executors.newVirtualThreadPerTaskExecutor(),
|
||||
CLOCK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user