[Core] Enhance jni signature with a more readable way
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 657
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 80
Description
### Description
Current the method signature is set with current plain text, which is not so good to maintain and read like "(J[J[II[B)V" and confusing for onboarding and in maintenance.
The signature is generated by the parameter type list and the return value type.
A better way is like below :
1. Build a map from type, which is via `typeid` in cpp, to signature
2. Create a method to generate the signature by the parameters type list and return type
3. Update the `getMethodIdOrError` from current signature to the parameter list and return type and call the method above
4. To make the above more readable and a better comprehensibility and encapsulation, we can declare a series variables to show the detailed meaning and pass it to the `getMethodIdOrError`.
5. Currently a draft PR for 1 and 2 are https://github.com/apache/incubator-gluten/pull/5888/files. I'll update the PR for step 3 and 4.
cc: @zhouyuan , @zhztheplayer , @FelixYBW
Contributor guide
Research direction
Start with the draft PR referenced in the issue, then inspect the getMethodIdOrError entry point and its callers. The work is done when signature generation and the call site use readable parameter and return-type descriptions while preserving the generated JNI signatures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100