Skip to content

HOWTO add your analytics node

Why do that

Developing your custom PML node and use it in any PML configuration file


An installed version of the punchplatform standalone version with spark.

What to do

Implement the Node interface

You must implement the node interface provided by the punchplatform-job library. You can install this dependency in your local maven repository by executing the command:



This command exports the platform jars in your local maven repository so that you can include dependencies in your maven projects. Of course if you are part of the punch community, you will directly work with the punch git repositories.

Add the punchplatform-job dependency printed by this command to you maven pom.xml file. You can now create a class implemented the interface :

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;


public class YourNode implements INode {

  private static final long serialVersionUID = 1L;

  @JsonProperty(value = "param_1")
  public String param_1 = "default_param";

  public YourNode() {

  public void execute(Input input, Output output) throws Exception {

  public void declare(IDeclarer declarer) throws Exception {
    declarer.subscribeSingleton(new TypeReference<Dataset<Row>>() {});

Deploy your Jar

Compile your algorithm into a jar (with maven, sbt, ...). To make a lightweight jar, consider provided libraries from spark and PunchPlatform:

### Copying your jar

## Setup
# let us suppose that we want to patch v5.6.0 of our standalone version
# let us suppose that this standalone comes with spark 2.4.3
export SPARK_VERSION=2.4.3
# let us suppose that your jar name is as below
export YOUR_JAR=myjar.jar

# Create directory if missing
# Directory one
mkdir -p $PUNCHPLATFORM_CONF_DIR/../external/punchplatform-operator-environment-${YOUR_STANDALONE_VERSION}/lib/custom_jars
# Directory two
mkdir -p $PUNCHPLATFORM_CONF_DIR/../external/external/punchplatform-${YOUR_STANDALONE_VERSION}/features/plugins/spark-${SPARK_VERSION}-bin-hadoop2.7/punchplatform/analytics/job/custom_jars

# copying the jars
cp ${YOUR_JAR} $PUNCHPLATFORM_CONF_DIR/../external/punchplatform-operator-environment-${YOUR_STANDALONE_VERSION}/lib/custom_jars/

cp ${YOUR_JAR} $PUNCHPLATFORM_CONF_DIR/../external/external/punchplatform-shiva-${YOUR_STANDALONE_VERSION}/features/plugins/spark-${SPARK_VERSION}-bin-hadoop2.7/punchplatform/analytics/job/custom_jars/

Use Your Node a PML configuration

You can now refer to your algorithm in a pipeline_stage:

    type: your_node_name
    component: your_component
    settings: {
        param_1: hello
    subscribe: [
          stream: input_stream
          component: input_component