Server: use linked list for autosync/sync lists

This commit is contained in:
2025-03-23 16:05:29 +01:00
parent 527395447c
commit 03850d3522
2 changed files with 4 additions and 3 deletions

View File

@@ -15,7 +15,8 @@ import jakarta.inject.Inject;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -47,7 +48,7 @@ public class AutosyncProcessor {
executorService.submit(() -> {
Log.info("Adding all to autosync");
ArrayList<JObjectKey> objs = new ArrayList<>();
List<JObjectKey> objs = new LinkedList<>();
txm.run(() -> {
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {
while (it.hasNext()) {

View File

@@ -110,7 +110,7 @@ public class SyncHandler {
}
public void doInitialSync(PeerId peer) {
ArrayList<JObjectKey> objs = new ArrayList<>();
List<JObjectKey> objs = new LinkedList<>();
txm.run(() -> {
Log.tracev("Will do initial sync for {0}", peer);
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {