public class MockSink extends RealtimeSink<co.cask.cdap.api.data.format.StructuredRecord>
| Modifier and Type | Class and Description |
|---|---|
static class |
MockSink.Config
Config for the sink.
|
| Modifier and Type | Field and Description |
|---|---|
static PluginClass |
PLUGIN_CLASS |
PLUGIN_TYPE| Constructor and Description |
|---|
MockSink(MockSink.Config config) |
| Modifier and Type | Method and Description |
|---|---|
static ETLPlugin |
getPlugin(File dir) |
static List<co.cask.cdap.api.data.format.StructuredRecord> |
getRecords(File dir,
int writeNum,
long timeout,
TimeUnit timeUnit)
Get the records written out by the writeNum call to write.
|
void |
initialize(RealtimeContext context) |
int |
write(Iterable<co.cask.cdap.api.data.format.StructuredRecord> records,
DataWriter dataWriter) |
configurePipeline, destroypublic static final PluginClass PLUGIN_CLASS
public MockSink(MockSink.Config config)
public void initialize(RealtimeContext context) throws Exception
initialize in interface StageLifecycle<RealtimeContext>initialize in class RealtimeSink<co.cask.cdap.api.data.format.StructuredRecord>Exceptionpublic int write(Iterable<co.cask.cdap.api.data.format.StructuredRecord> records, DataWriter dataWriter) throws Exception
write in class RealtimeSink<co.cask.cdap.api.data.format.StructuredRecord>Exceptionpublic static List<co.cask.cdap.api.data.format.StructuredRecord> getRecords(File dir, int writeNum, long timeout, TimeUnit timeUnit) throws IOException, InterruptedException, ExecutionException, TimeoutException
dir - the temporary directory that results are written towriteNum - the number of times write was calledtimeout - how long to waittimeUnit - time unit for how long to waitIOExceptionInterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.