-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-38998: [Java] Build memory-core and memory-unsafe as JPMS modules #39011
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c455e67
Fix CData related test failures
jduo dd0647a
Refactor memory modules for JPMS support
jduo ceb41eb
Add module-info for memory-core and memory-unsafe
jduo dcff64b
Ignore TestBaseAllocator#testRootAllocator_getEmpty
jduo e489d26
Edit TestArrowBuf#testEnabledHistoricalLog to have more info
jduo 3f9c45f
Allow use of reflection on Unsafe from memory-core
jduo ee86308
Provide better error message about needing memory-core to have access…
jduo f61bb9e
Allow memory-core to use reflection on memory-unsafe
jduo aee387c
Add explicit dependency on immutables to memory-unsafe
jduo a7dee75
Enable reflection during arrow-memory-core tests
jduo 2847ee5
Fix occasionally ConcurrentModificationException in Netty tests
jduo 37b48c1
Correct the SLF4J JPMS module in memory-cpre
jduo b5303d6
Add a test-only dependency on logback to memory-core
jduo b121079
Address PR feedback
jduo eec32bb
Update docs and archery tester for arrow-memory modules
jduo 6597ba9
Update maven-javadoc-plugin to 3.6.3
jduo fdd2c76
Disable javadoc generation on module-info.java
jduo 0de759c
Attempt to fix javadoc issues
jduo 98f94c8
Fix null checking in CountingAllocationListener
jduo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,6 +125,4 @@ | |
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
|
|
||
| </project> | ||
| </project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| module org.apache.arrow.memory.core { | ||
| exports org.apache.arrow.memory; | ||
| exports org.apache.arrow.memory.rounding; | ||
| exports org.apache.arrow.memory.util; | ||
| exports org.apache.arrow.memory.util.hash; | ||
| exports org.apache.arrow.util; | ||
| requires transitive jdk.unsupported; | ||
| requires jsr305; | ||
| requires org.immutables.value; | ||
| requires org.slf4j; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,11 @@ | |
|
|
||
| package org.apache.arrow.memory; | ||
|
|
||
| import org.apache.arrow.memory.AllocationListener; | ||
| import org.apache.arrow.memory.AllocationOutcome; | ||
| import org.apache.arrow.memory.BufferAllocator; | ||
| import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
|
||
| /** | ||
| * Counting allocation listener. | ||
| * It counts the number of times it has been invoked, and how much memory allocation it has seen | ||
|
|
@@ -30,6 +35,7 @@ final class CountingAllocationListener implements AllocationListener { | |
| private long totalMem; | ||
| private long currentMem; | ||
| private boolean expandOnFail; | ||
| @Nullable | ||
| BufferAllocator expandAlloc; | ||
| long expandLimit; | ||
|
|
||
|
|
@@ -58,6 +64,10 @@ public void onAllocation(long size) { | |
| @Override | ||
| public boolean onFailedAllocation(long size, AllocationOutcome outcome) { | ||
| if (expandOnFail) { | ||
| if (expandAlloc == null) { | ||
|
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. Could possibly use Preconditions.checkState for this (since it's been annotated such that CheckerFramework should understand it) |
||
| throw new IllegalStateException("expandAlloc must be non-null because this " + | ||
| "listener is set to expand on failure."); | ||
| } | ||
| expandAlloc.setLimit(expandLimit); | ||
| return true; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would this require a documentation update?
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.
Yes, this would be a doc update. A similar change would be necessary for flight-core.
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.
should we include it to this PR or file a separate issue for that?
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.
I think it's best to do a separate PR for doc updates around this since there are a few of these across multiple PRs.