spark-java

Where to put static files for Spark Web Framework?

青春壹個敷衍的年華 提交于 2019-11-27 00:53:23
问题 Where do I put files when trying to serve static files with the Spark web framework? I haven't been able to find anything online - I'm beginning to suspect I don't understand anything about class paths, relative paths etc. for an Eclipse and Java project. This paragraph about static files in Spark refers to /public , but I have no idea where that would be. Using windows, Eclipse Luna and my project is converted to use Maven. I've tried looking at the code on GitHub, but I'm a little out of my

java.lang.ClassCastException using lambda expressions in spark job on remote server

你。 提交于 2019-11-26 08:25:54
问题 I\'m trying to build a web api for my apache spark jobs using sparkjava.com framework. My code is: @Override public void init() { get(\"/hello\", (req, res) -> { String sourcePath = \"hdfs://spark:54310/input/*\"; SparkConf conf = new SparkConf().setAppName(\"LineCount\"); conf.setJars(new String[] { \"/home/sam/resin-4.0.42/webapps/test.war\" }); File configFile = new File(\"config.properties\"); String sparkURI = \"spark://hamrah:7077\"; conf.setMaster(sparkURI); conf.set(\"spark.driver