Bullet on Spark

This section explains how to set up and run Bullet on Spark.


Bullet is configured at run-time using settings defined in a file. Settings not overridden will default to the values in bullet_spark_defaults.yaml. You can find out what these settings do in the comments listed in the defaults.


Download the Bullet Spark standalone jar from JCenter.

If you are using Bullet Kafka as pluggable PubSub, you can download the fat jar from JCenter. Otherwise, you need to plug in your own PubSub jar or use the RESTPubSub built-into bullet-core and turned on in the API.

To use Bullet Spark, you need to implement your own Data Producer Trait with a JVM based project. You have two ways to implement it as described in the Spark Architecture section. You include the Bullet artifact and Spark dependencies in your pom.xml or other equivalent build tools. The artifacts are available through JCenter. Here is an example if you use Scala and Maven:






You can also add <classifier>sources</classifier> or <classifier>javadoc</classifier> if you want the sources or javadoc.


After you have implemented your own data producer and built a jar, you could launch your Bullet Spark application. Here is an example command for a YARN cluster.

./bin/spark-submit \
    --master yarn \
    --deploy-mode cluster \
    --class com.yahoo.bullet.spark.BulletSparkStreamingMain \
    --queue <your queue> \
    --executor-memory 12g \
    --executor-cores 2 \
    --num-executors 200 \
    --driver-cores 2 \
    --driver-memory 12g \
    --conf spark.streaming.backpressure.enabled=true \
    --conf spark.default.parallelism=20 \
    ... # other Spark settings
    --jars /path/to/your-data-producer.jar,/path/to/your-pubsub.jar \
    /path/to/downloaded-bullet-spark-standalone.jar \
    --bullet-spark-conf /path/to/your-settings.yaml

You can pass other Spark settings by adding --conf key=value to the command. For more settings, you can refer to the Spark Configuration.

For other platforms, you can find the commands from the Spark Documentation.