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

Hazelcast 3.4.0 support #515

Open
simonhir opened this issue Jul 18, 2024 · 5 comments
Open

Hazelcast 3.4.0 support #515

simonhir opened this issue Jul 18, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@simonhir
Copy link

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.

@simonhir simonhir added the enhancement New feature or request label Jul 18, 2024
@simonhir
Copy link
Author

simonhir commented Jul 18, 2024

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?

@dnestoro
Copy link
Member

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

@dnestoro
Copy link
Member

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: #462

@simonhir
Copy link
Author

simonhir commented Sep 3, 2024

Hey @dnestoro

thank you for you explanation.
Hadn't time to do it yet. Hope to get to it next week.

@simonhir
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants