gortiz commented on issue #12809:
URL: https://github.com/apache/pinot/issues/12809#issuecomment-2082757464

   > why cant we use reflection as discussed in para 1 
[here](https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html#the-forward-compatibility-solution)?
   
   What do you mean with that? To always call the methods using reflection? 
That sounds unsafe for sure and probably not very efficient. And the buffer 
code is part of the Pinot hot path, so it should be as efficient as possible. 
By unsafe I mean that if for whatever reason we end up even loading the class 
that is compiled with Java > 11 we will end up with an unexpected error in 
runtime.
   
   Therefore we cannot add code compiled with Java 22 in the main source code 
because we need our executables to be compatible with Java 11 (and the driver 
with Java 8). The clean solution to do that is multi-module projects. You can 
see in Pinot distributables that our dependencies are already doing that 
(including for example roaringbitmap).
   
   I think the solution named as 
[single-project](https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html#single-project)
 in maven documentation should be fine. Specifically, we need a project with no 
code in the main source folder (where Java 11 compatible code must stay) and 
then another folder for Java 22 should contain all the new code. Then with 
Maven we would only compile Java 22 code if the JRE running the compilation 
process is at least Java 22.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to