[Java] Support graalvm native image#1143
Merged
theweipeng merged 20 commits intoapache:mainfrom Nov 28, 2023
Merged
Conversation
3d01903 to
8057fa0
Compare
2d7acd1 to
f528c69
Compare
d7c2c60 to
3fd9a21
Compare
Collaborator
Author
theweipeng
approved these changes
Nov 28, 2023
8 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What do these changes do?
This PR supported run fury on graalvm native image by generate all serializer code and class at graalvm build time. The main changes includes:
Unsafe.objectOffsetadapt to graalvm auto replace patterninvokeDynamicandjava.lang.invoke.LambdaMetafactorycodegen by cache the generated functions at build timeUsage Example:
The Fury instance must be hold as an static variable and the enclosing class must be init at graalvm build time.
Neither graalvm reflect config nor serialization config as described in https://www.graalvm.org/jdk17/reference-manual/native-image/metadata/#serialization are needed.
The thread safe fury support and detailed user document will be provided in following up PRs.
Related issue number
Closes #1115 #678
Check code requirements