Spark java communication