We are trying to integrate our HCFS implementation with HDP. Our file system implementation uses native library (say /usr/lib/jni/myfs.so). The native library is loaded in a static block (once per class loader) through java filesystem class MyfsFileSystem.java.
For Ambari views to access our file system implementation jar (MyfsFileSystem.jar) we copied it at below locations:
So here is the problem,
When I click on File view UI the operation succeeds, internally the class-loader loads the MyfsFileSystem.jar and the myfs.so library gets successfully loaded, but when I click on the hive view it fails to load the library and throws server error with exception java.lang.UnsatisfiedLinkError in ambari logs.
As per our understanding, for every web app a class-loader exists and it tries to load the library. When the library is loaded through one of the ambari views (in above case File views), the other class-loader (say for hive view) fails to load the library.
To solve this problem, we want our native library be loaded once for all views/webapps.
Is there a way to load library only once for all ambari views (webapps) ?
In tomcat this is achievable by placing the jar in $CATALINA_HOME/lib, but how can we do the same for ambari.