-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-39265: [Java] Make it run well with the netty newest version 4.1.104 #39266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6423ff4
fcc442a
0bfe61c
1248aca
587f918
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ public UnsafeDirectLittleEndian allocate(long size) { | |
| } | ||
|
|
||
| public int getChunkSize() { | ||
| return allocator.chunkSize; | ||
| return allocator.chunkSize(); | ||
| } | ||
|
|
||
| public long getHugeBufferSize() { | ||
|
|
@@ -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); | ||
|
|
@@ -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(this); | ||
| statusThread.start(); | ||
|
|
@@ -166,7 +163,7 @@ private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCa | |
|
|
||
| if (directArena != null) { | ||
|
|
||
| if (initialCapacity > directArena.chunkSize) { | ||
| if (initialCapacity > chunkSize()) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. One final thing, I think chunkSize is deprecated in Netty? Is it possible to use the non-deprecated version? |
||
| // This is beyond chunk size so we'll allocate separately. | ||
| ByteBuf buf = UnpooledByteBufAllocator.DEFAULT.directBuffer(initialCapacity, maxCapacity); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From code analysis, it seems that the
chunkSizefield here is useless. After the constructor is assigned, it is no longer used, and this value is directly derived from the parent class. So I suggest removing it.