Skip to content

Commit

Permalink
#12689 handle review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Jan 10, 2025
1 parent 81c66a9 commit 967f39e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public class ArrayByteBufferPool implements ByteBufferPool, Dumpable
private final IntUnaryOperator _bucketIndexFor;
private final IntUnaryOperator _bucketCapacity;
private final AtomicBoolean _evictor = new AtomicBoolean(false);
private final ConcurrentMap<Integer, Long> _noBucketDirectSizes = new ConcurrentHashMap<>();
private final ConcurrentMap<Integer, Long> _noBucketIndirectSizes = new ConcurrentHashMap<>();
private final ConcurrentMap<Integer, Long> _noBucketDirectAcquires = new ConcurrentHashMap<>();
private final ConcurrentMap<Integer, Long> _noBucketIndirectAcquires = new ConcurrentHashMap<>();
private boolean _statisticsEnabled;

/**
Expand Down Expand Up @@ -236,7 +236,7 @@ private void recordNoBucketAcquire(int size, boolean direct)
{
if (isStatisticsEnabled())
{
ConcurrentMap<Integer, Long> map = direct ? _noBucketDirectSizes : _noBucketIndirectSizes;
ConcurrentMap<Integer, Long> map = direct ? _noBucketDirectAcquires : _noBucketIndirectAcquires;
int idx = _bucketIndexFor.applyAsInt(size);
int key = _bucketCapacity.applyAsInt(idx);
map.compute(key, (k, v) ->
Expand Down Expand Up @@ -452,9 +452,9 @@ public long getAvailableHeapMemory()
public void clear()
{
clearBuckets(_direct);
_noBucketDirectSizes.clear();
_noBucketDirectAcquires.clear();
clearBuckets(_indirect);
_noBucketIndirectSizes.clear();
_noBucketIndirectAcquires.clear();
}

private void clearBuckets(RetainedBucket[] buckets)
Expand All @@ -473,9 +473,9 @@ public void dump(Appendable out, String indent) throws IOException
indent,
this,
DumpableCollection.fromArray("direct", _direct),
new DumpableMap("direct non-pooled acquisitions", _noBucketDirectSizes),
new DumpableMap("direct non-pooled acquisitions", _noBucketDirectAcquires),
DumpableCollection.fromArray("indirect", _indirect),
new DumpableMap("indirect non-pooled acquisitions", _noBucketIndirectSizes)
new DumpableMap("indirect non-pooled acquisitions", _noBucketIndirectAcquires)
);
}

Expand Down

0 comments on commit 967f39e

Please sign in to comment.