T - Type of object that the source emits@Beta public abstract class RealtimeSource<T> extends Object implements PipelineConfigurable, StageLifecycle<RealtimeContext>
| Modifier and Type | Field and Description |
|---|---|
static String |
PLUGIN_TYPE |
| Constructor and Description |
|---|
RealtimeSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
configurePipeline(PipelineConfigurer pipelineConfigurer)
Configure an ETL pipeline, adding datasets and streams that the stage needs.
|
void |
destroy()
Destroy the Source.
|
void |
initialize(RealtimeContext context)
Initialize the Source.
|
abstract SourceState |
poll(Emitter<T> writer,
SourceState currentState)
Poll for new data.
|
public static final String PLUGIN_TYPE
public void configurePipeline(PipelineConfigurer pipelineConfigurer)
PipelineConfigurableconfigurePipeline in interface PipelineConfigurablepipelineConfigurer - the configurer used to add required datasets and streamspublic void initialize(RealtimeContext context) throws Exception
poll(co.cask.cdap.etl.api.Emitter<T>, co.cask.cdap.etl.api.realtime.SourceState)
are made.initialize in interface StageLifecycle<RealtimeContext>context - RealtimeContextException - if there is any error during initialization@Nullable public abstract SourceState poll(Emitter<T> writer, SourceState currentState) throws Exception
writer - EmittercurrentState - SourceState current state of the sourceSourceState state of the source after poll, will be persisted when all data from poll are processedException - if there's an error during this method invocationpublic void destroy()
destroy in interface DestroyableCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.