graalvm-reachability-metadata
graalvm-reachability-metadata copied to clipboard
Hazelcast 3.4.0 support
Is your feature request related to a problem? Please describe.
Hazelcast currently is not working with version 3.4.0 (also 4.3.6) as some metadata ist missing.
Describe the solution you'd like
Add missing metadata for supporting hazelcast 3.4.0.
Describe alternatives you've considered
Don't update metadata: hazelcast no longer works in native images from at least version 4.3.6
Additional context
We currently are trying to run a spring-cloud-gateway with spring-session-hazelcast and hazelcast (3.4.0) as native image. While starting there are some hazelcast reflections missing.
To solve this i already collected metadata for the above mentioned application.
Then filtered the metadata for com.hazelcast.** which led to following raw metadata:
filtered-metadata.zip
After a bit of working around and reducing the metadata i got our application running with following:
reflection-config.json
[
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField",
"fields": [
{
"name": "consumerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField",
"fields": [
{
"name": "producerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField",
"fields": [
{
"name": "consumerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField",
"fields": [
{
"name": "producerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.instance.BuildInfoProvider"
},
"name": "com.hazelcast.instance.GeneratedBuildProperties",
"fields": [
{
"name": "ARTIFACT_ID"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.internal.metrics.impl.MetricsCollectionCycle"
},
"name": "com.hazelcast.internal.partition.impl.MigrationStats",
"methods": [
{
"name": "getElapsedDestinationCommitTimeNanoseconds",
"parameterTypes": []
},
{
"name": "getElapsedMigrationOperationTimeNanoseconds",
"parameterTypes": []
},
{
"name": "getElapsedMigrationTimeNanoseconds",
"parameterTypes": []
},
{
"name": "getTotalElapsedDestinationCommitTimeNanoseconds",
"parameterTypes": []
},
{
"name": "getTotalElapsedMigrationOperationTimeNanoseconds",
"parameterTypes": []
},
{
"name": "getTotalElapsedMigrationTimeNanoseconds",
"parameterTypes": []
}
]
}
]
The question for me now is how am i correctly contributing this? Just copy the existing test and modify it so that the tests lead exactly to the above missing?
Hey @simonhir, here is our guide on how to contribute metadata: https://github.com/oracle/graalvm-reachability-metadata/blob/master/CONTRIBUTING.md I guess you will be able to find answers to all your questions there. If something remains unclear, feel free to ask
Hey @simonhir, I just wanted to check if you had any troubles making a pull request according to our docs. It should be pretty simple, just:
- clone the repo
- generate metadata and test stubs using
./gradlew scaffold --coordinates com.example:my-library:1.0.0(just change coordinates to your library coordinates) - add your tests into generated test file
- then you can run your test with
./gradlew test -Pcoordinates=com.example:my-library:1.0.0 - to generate metadata please see this. Basically you have to add one config block into
build.gradle(see) and perform./gradlew -Pagent(for more details and how to copy metadata to the certain place, please see this)
Here is an example of a pull request: https://github.com/oracle/graalvm-reachability-metadata/pull/462
Hey @dnestoro
thank you for you explanation. Hadn't time to do it yet. Hope to get to it next week.
Unfortunately, I still haven't had time due to other projects. However, I should definitely be able to do this by mid-October and then implement the whole thing directly for the latest version.
Looked in today but couldn't get it working. Has nothing to do with the above instructions but with the Hazelcast tests themselves.
What i tried to do is copy and modify the existing tests, as i never worked with Hazelcast itself but always through spring-session-hazelcast and thought that must be the easiest way. The execution of the tests brought me to multiple problems:
- They use java enterprise features (Which i don't have)
- The tests try to connect via my network ip address instead of localhost, which isn't listening (couldn't got that fixed)
- Deprecation of
Portable Serialization(which i could refactor but breaks the tests and as i don't work with Hazelcast itself I can't assess whether the changes are equivalent)
All in all, it probably makes much more sense for someone who is familiar with Hazelcast to do this.
Any update on this? I added Hazelcast 5.5.0 to my Spring Boot app but it now fails with all sorts of NoSuchFieldException related to Hazelcast types, for example:
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: producerIndex
at com.hazelcast.shaded.org.jctools.util.UnsafeAccess.fieldOffset(UnsafeAccess.java:111)
at com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField.<clinit>(MpmcArrayQueue.java:51)
... 193 more
Caused by: java.lang.NoSuchFieldException: producerIndex
at [email protected]/java.lang.Class.checkField(DynamicHub.java:1151)
at [email protected]/java.lang.Class.getDeclaredField(DynamicHub.java:1293)
at com.hazelcast.shaded.org.jctools.util.UnsafeAccess.fieldOffset(UnsafeAccess.java:107)
... 194 more