Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
c455e67dd0647aceb41ebdcff64be489d263f9c45fee86308f61bb9eaee387ca7dee752847ee537b48c1b5303d6b121079eec32bb6597ba9fdd2c760de759c98f94c8File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -125,6 +125,4 @@ | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
| </project> | ||
| 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; | ||
| } |
| 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; | ||
| } | ||
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.
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.