public class MockExternalSource extends BatchSource<LongWritable,Text,co.cask.cdap.api.data.format.StructuredRecord>
| Modifier and Type | Class and Description |
|---|---|
static class |
MockExternalSource.Config
Config for the source.
|
| Modifier and Type | Field and Description |
|---|---|
static PluginClass |
PLUGIN_CLASS |
static String |
PLUGIN_NAME |
PLUGIN_TYPE| Constructor and Description |
|---|
MockExternalSource(MockExternalSource.Config config) |
| Modifier and Type | Method and Description |
|---|---|
static ETLPlugin |
getPlugin(String name,
String dirName) |
void |
prepareRun(BatchSourceContext context) |
void |
transform(KeyValue<LongWritable,Text> input,
Emitter<co.cask.cdap.api.data.format.StructuredRecord> emitter) |
static void |
writeInput(String fileName,
Iterable<co.cask.cdap.api.data.format.StructuredRecord> records)
Used to write the input records for the pipeline run.
|
destroy, initializeconfigurePipeline, onRunFinishpublic static final PluginClass PLUGIN_CLASS
public static final String PLUGIN_NAME
public MockExternalSource(MockExternalSource.Config config)
public void transform(KeyValue<LongWritable,Text> input, Emitter<co.cask.cdap.api.data.format.StructuredRecord> emitter) throws Exception
transform in interface Transformation<KeyValue<LongWritable,Text>,co.cask.cdap.api.data.format.StructuredRecord>transform in class BatchSource<LongWritable,Text,co.cask.cdap.api.data.format.StructuredRecord>Exceptionpublic void prepareRun(BatchSourceContext context) throws Exception
prepareRun in interface SubmitterLifecycle<BatchSourceContext>prepareRun in class BatchConfigurable<BatchSourceContext>Exceptionpublic static void writeInput(String fileName, Iterable<co.cask.cdap.api.data.format.StructuredRecord> records) throws Exception
fileName - file to write the records intorecords - records that should be the input for the pipelineExceptionCopyright © 2017 Cask Data, Inc. Licensed under the Apache License, Version 2.0.