*gandiva* does the sharing in one direction i.e buffers allocated in java, and passed along to c++ in jni calls.
The java side code of extracting of the address and passing it down is here <https://github.com/apache/arrow/blob/master/java/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java#L214>, the cpp side of building arrow-bufs and record batches using the addresses passed from java is here <https://github.com/apache/arrow/blob/master/cpp/src/gandiva/jni/jni_common.cc#L505> we have recently added support to re-alloc/grow the buffers <https://github.com/apache/arrow/pull/4771>via back-calls into java. *ORC *does the sharing in one direction i.e buffers are allocated in c++, shared with java. It creates a ReferenceManager <https://github.com/apache/arrow/blob/master/java/adapter/orc/src/main/java/org/apache/arrow/adapter/orc/OrcReferenceManager.java>over the cpp alloced buffers. On Wed, Jul 17, 2019 at 9:26 PM <hans-joachim.bo...@web.de> wrote: > Thanks to Uwe! The Python step from C++ would have been next. You hit it! > Perfect shortcut. > > Jacques, i am new here but i am gladly willing to help and learn. if you > could give me a hint for an outline and content of the blog post and > where/how to file it. Will read #3191 next. > > greetings & thanks, > Hans > -- > Diese Nachricht wurde von meinem Android Mobiltelefon mit WEB.DE Mail > gesendet. > Am 17.07.19, 17:14, Jacques Nadeau <jacq...@apache.org> schrieb: > > Java > C++ has been available for a long time, I believe. With > ARROW-3191, > we now have a good story as well for C++ > Java. > > Reference management is the key thing you have to think about. Now > that we > have the ReferenceManager interface in Java, you can decide how this > works > between the two layers. > > A blog post by someone on this would be great. If others don't get to > this, > I'll see if I can. > > On Wed, Jul 17, 2019 at 5:42 AM Uwe L. Korn <uw...@xhochy.com> wrote: > > > Hello Hans, > > > > we sadly have no code for the C++<->Java interaction but a good > example is > > the Python<->Java interaction code in > > https://github.com/apache/arrow/blob/master/python/pyarrow/jvm.py . > This > > call Java from Python using the jpype1 module and then uses the > memory > > pointers in the Java objects to construct pyarrow objects out of it. > > > > Cheers > > Uwe > > > > On Wed, Jul 17, 2019, at 2:38 PM, hans-joachim.bo...@web.de wrote: > > > In my application I need to share Arrow buffers allocated in Java > with > > > C++ in the same process. > > > Is there already some code in Arrow to pass the native address from > > > Java to C++ or do I have to do my own JNI call? > > > I do not want to go via the Plasma sockets and did not find any > hint in > > > docs and Jira. > > > > > > Can anybody point me to the right place or confirm that this is to > be > > done ? > > > > > > Thanks, > > > Hans. > > > > > > -- Thanks and regards, Ravindra.