Creating a Runtime Class
Define what happens when the user clicks Run from the application.
For this tutorial, the goal is to just submit a Spark job. Because of this, the Runtime class looks empty, but the base class to extend from does the work of launching the Spark job.
Before you beginCreating the onInputOrParameterChange Method.
- Procedure
- Add the following code:
class SimpleDatasetGeneratorRuntime extends SparkRuntimeWithIOTypedJob[SimpleDatasetGeneratorJob, IONone, HdfsTabularDataset] {}In the above example code, the class,
SimpleDatasetGeneratorRuntime, extendsSparkRuntimeWithIOTypedJob. Use this base class to launch a Spark job without having to write extra code to handle that. This makes it very easy to integrate Spark code into the TIBCO Data Science - Team Studio platform. As type parameters, pass the following.SimpleDatasetGeneratorJob- The name of your Spark job, which we implement below.IONone- The input type. Because we are building a source operator, it has no input.HdfsTabularDataset- The output type. Our operator returns a file on HDFS with the new data it generates.
Note: The data type of the input and output matches that which is defined in the GUI Node class, and both of them extendIOBase.
What to do nextCreate a Spark job.