-
Notifications
You must be signed in to change notification settings - Fork 26
Getting Started With EclairJS Server
The purpose of EclairJS Server is to expose the Apache Spark programming model to JavaScript. It consists of an interpreter which instantiates Nashorn, resolves Spark Java method references and initiates code evaluation and also a Java wrapper which, along with Nashorn, execute lambda functions and handle type conversions on Worker nodes.
EclairJS Server can be used independently from EclairJS Client.
Build the Server JAR as specified in the README. Once built, you can use the server JAR in the following three ways:
- As mentioned in the README on the main page you can use the eclairjs.sh script to:
- Run a simple example to count words:
bin/eclairjs.ah examples/word_count.js
or
- To enter REPL mode:
bin/eclairjs.sh
eclairJS>var conf = new SparkConf().setAppName("Sample App").setMaster("local[*]");
var sparkContext = new SparkContext(conf);
-
If you are comfortable with using notebooks, you can follow the section on Usage with Jupyter Notebooks in the README for this project to start to explore the EclairJS Server API and work with Apache Spark through JavaScript.
-
Finally, you can use the EclairJS Server Jar with EclairJS Client, the other component to EclairJS.