From 1e3386ea97cfad231723baec96b9db238aa8ba3e Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Thu, 27 Jun 2024 14:18:08 -0600 Subject: [PATCH] fixed: switched queue implementation details Signed-off-by: Matt Peterson --- .../block/server/persistence/WriteThroughCacheHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/hedera/block/server/persistence/WriteThroughCacheHandler.java b/server/src/main/java/com/hedera/block/server/persistence/WriteThroughCacheHandler.java index e59efee49..277e5cb2d 100644 --- a/server/src/main/java/com/hedera/block/server/persistence/WriteThroughCacheHandler.java +++ b/server/src/main/java/com/hedera/block/server/persistence/WriteThroughCacheHandler.java @@ -20,6 +20,7 @@ import com.hedera.block.server.persistence.storage.BlockStorage; import java.util.ArrayDeque; +import java.util.LinkedList; import java.util.Optional; import java.util.Queue; @@ -63,13 +64,13 @@ public Long persist(final BlockStreamServiceGrpcProto.Block block) { */ @Override public Queue readRange(final long startBlockId, final long endBlockId) { - final Queue blocks = new ArrayDeque<>(); + final Queue blocks = new LinkedList<>(); long count = startBlockId; Optional blockOpt = read(count); while (count <= endBlockId && blockOpt.isPresent()) { final BlockStreamServiceGrpcProto.Block block = blockOpt.get(); - blocks.offer(block); + blocks.add(block); blockOpt = read(++count); }