Skip to content
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

ARROW-17794: [Java] Force delete jni lib file on JVM exit #14189

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.util.List;
import java.util.Set;

import org.apache.commons.io.FileUtils;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not needed to add commons-io as a Dataset module dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your attension, I have change the way to delete file. No need to use FileUtils as it is a file.


/**
* The JniLoader for Dataset API's native implementation.
*/
Expand Down Expand Up @@ -79,6 +81,7 @@ private void load(String name) {
final String libraryToLoad = System.mapLibraryName(name);
try {
File temp = File.createTempFile("jnilib-", ".tmp", new File(System.getProperty("java.io.tmpdir")));
FileUtils.forceDeleteOnExit(temp);
try (final InputStream is
= JniWrapper.class.getClassLoader().getResourceAsStream(libraryToLoad)) {
if (is == null) {
Expand Down