I've gotten some work done on NIFI-455. I'm building a shared library in C,
and calling functions in that library using JNI. I've been working in a
separate repo (https://github.com/trkurc/offheap) for now as I'm struggling
a bit with where native code should live in the source tree and how it
should be built and distributed. I'm hoping to get some suggestions.. I've
seen quite a bit of variety in the way other java projects include native
code such as (mixed into maven-friendly source tree, maven build with ant
run plugin with cmake and make) [1] (similar, but just with ant-run with
cmake) [2] (separate part of source tree with pom that invokes make via
executable plugin) [3].

Building and putting in the source tree is one issue. The next couple
integration steps are getting the shared library somewhere sensible and
setting up the environment to load, (and doing sensible things if the
shared library can't be found).

If people have thoughts, or idioms that other projects use that we may be
able to borrow, I'd like to know!

Tony

[1]
https://github.com/apache/hadoop/tree/3c9181722b05a9192f5440ea8f3f77231f84eac6/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src
[2]
https://github.com/apache/hbase/tree/543c64d2e9d2fc608ef65cafd485a910d4b8d480/hbase-server/src/main/native/src
[3]
https://github.com/apache/accumulo/tree/be4aade67b0f0711e25de9ac01552471b48a75af/server/native

*parens included to improve groupin

Reply via email to