Hi,

I am trying to invoke C library from the Spark Stack using JNI interface
(here is sample  application code)


class SimpleApp {
 // ---Native methods
@native def foo (Top: String): String
}

object SimpleApp  {
   def main(args: Array[String]) {

    val conf = new
SparkConf().setAppName("SimpleApplication").set("SPARK_LIBRARY_PATH", "lib")
    val sc = new SparkContext(conf)
     System.loadLibrary("foolib")
    //instantiate the class
     val SimpleAppInstance = new SimpleApp
    //String passing - Working
    val ret = SimpleAppInstance.foo("fooString")
  }

Above code work fines.

I have setup LD_LIBRARY_PATH and spark.executor.extraClassPath,
spark.executor.extraLibraryPath
at worker node

How can i invoke JNI library from worker node ? Where should i load it in
executor ?
Calling  System.loadLibrary("foolib") inside the work node gives me
following error :

Exception in thread "main" java.lang.UnsatisfiedLinkError:

Any help would be really appreciated.

Reply via email to