Skip to content

Commit

Permalink
DX-86156: Cherry pick a4a3d3f for apacheGH-39265
Browse files Browse the repository at this point in the history
  • Loading branch information
panbingkun authored and lriggs committed Jan 4, 2024
1 parent e910dac commit 2f3a61c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public UnsafeDirectLittleEndian allocate(long size) {
}

public int getChunkSize() {
return allocator.chunkSize;
return allocator.chunkSize();
}

public long getHugeBufferSize() {
Expand Down Expand Up @@ -137,7 +137,6 @@ private class InnerAllocator extends PooledByteBufAllocator {

private final PoolArena<ByteBuffer>[] directArenas;
private final MemoryStatusThread statusThread;
private final int chunkSize;

public InnerAllocator() {
super(true);
Expand All @@ -150,8 +149,6 @@ public InnerAllocator() {
throw new RuntimeException("Failure while initializing allocator. Unable to retrieve direct arenas field.", e);
}

this.chunkSize = directArenas[0].chunkSize;

if (memoryLogger.isTraceEnabled()) {
statusThread = new MemoryStatusThread();
statusThread.start();
Expand All @@ -166,7 +163,7 @@ private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCa

if (directArena != null) {

if (initialCapacity > directArena.chunkSize) {
if (initialCapacity > chunkSize()) {
// This is beyond chunk size so we'll allocate separately.
ByteBuf buf = UnpooledByteBufAllocator.DEFAULT.directBuffer(initialCapacity, maxCapacity);

Expand Down
14 changes: 7 additions & 7 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<properties>
<target.gen.source.path>${project.build.directory}/generated-sources</target.gen.source.path>
<dep.junit.platform.version>1.9.0</dep.junit.platform.version>
<dep.junit.jupiter.version>5.9.0</dep.junit.jupiter.version>
<dep.slf4j.version>1.7.25</dep.slf4j.version>
<dep.guava-bom.version>31.1-jre</dep.guava-bom.version>
<dep.netty-bom.version>4.1.96.Final</dep.netty-bom.version>
<dep.grpc-bom.version>1.56.0</dep.grpc-bom.version>
<dep.protobuf-bom.version>3.21.9</dep.protobuf-bom.version>
<dep.jackson-bom.version>2.13.4</dep.jackson-bom.version>
<dep.junit.jupiter.version>5.10.1</dep.junit.jupiter.version>
<dep.slf4j.version>2.0.9</dep.slf4j.version>
<dep.guava-bom.version>32.1.3-jre</dep.guava-bom.version>
<dep.netty-bom.version>4.1.104.Final</dep.netty-bom.version>
<dep.grpc-bom.version>1.60.0</dep.grpc-bom.version>
<dep.protobuf-bom.version>3.23.1</dep.protobuf-bom.version>
<dep.jackson-bom.version>2.16.0</dep.jackson-bom.version>
<dep.hadoop.version>2.7.1</dep.hadoop.version>
<dep.fbs.version>1.12.0</dep.fbs.version>
<dep.avro.version>1.10.0</dep.avro.version>
Expand Down

0 comments on commit 2f3a61c

Please sign in to comment.