Skip to content

Commit

Permalink
Merge branch 'main' into fix/bubble_session_loop_exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel authored Mar 13, 2023
2 parents 331dc87 + 7797062 commit e1357c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class QueuePool {

static final boolean queueDebug = Boolean.parseBoolean(System.getProperty("moquette.queue.debug", "false"));

private static SegmentAllocationCallback callback;
private final SegmentAllocationCallback callback;

// visible for testing
static class SegmentRef implements Comparable<SegmentRef> {
Expand Down Expand Up @@ -104,6 +104,7 @@ private QueuePool(SegmentAllocator allocator, Path dataPath, int segmentSize) {
this.allocator = allocator;
this.dataPath = dataPath;
this.segmentSize = segmentSize;
this.callback = new SegmentAllocationCallback(this);
}

private static class SegmentAllocationCallback implements PagedFilesAllocator.AllocationListener {
Expand Down Expand Up @@ -142,7 +143,6 @@ public static QueuePool loadQueues(Path dataPath, int pageSize, int segmentSize)
final PagedFilesAllocator allocator = new PagedFilesAllocator(dataPath, pageSize, segmentSize, lastPage, lastSegment);

final QueuePool queuePool = new QueuePool(allocator, dataPath, segmentSize);
callback = new SegmentAllocationCallback(queuePool);
queuePool.loadQueueDefinitions(checkpointProps);
LOG.debug("Loaded queues definitions: {}", queuePool.queueSegments);

Expand Down

0 comments on commit e1357c5

Please sign in to comment.