mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
Server: use linked list for autosync/sync lists
This commit is contained in:
@@ -15,7 +15,8 @@ import jakarta.inject.Inject;
|
|||||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||||
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
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.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ public class AutosyncProcessor {
|
|||||||
|
|
||||||
executorService.submit(() -> {
|
executorService.submit(() -> {
|
||||||
Log.info("Adding all to autosync");
|
Log.info("Adding all to autosync");
|
||||||
ArrayList<JObjectKey> objs = new ArrayList<>();
|
List<JObjectKey> objs = new LinkedList<>();
|
||||||
txm.run(() -> {
|
txm.run(() -> {
|
||||||
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {
|
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class SyncHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void doInitialSync(PeerId peer) {
|
public void doInitialSync(PeerId peer) {
|
||||||
ArrayList<JObjectKey> objs = new ArrayList<>();
|
List<JObjectKey> objs = new LinkedList<>();
|
||||||
txm.run(() -> {
|
txm.run(() -> {
|
||||||
Log.tracev("Will do initial sync for {0}", peer);
|
Log.tracev("Will do initial sync for {0}", peer);
|
||||||
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {
|
try (var it = curTx.getIterator(IteratorStart.GE, JObjectKey.first())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user