Package org.apache.iotdb.pipe.api
Interface PipeExtractor
- All Superinterfaces:
AutoCloseable,PipePlugin
- All Known Subinterfaces:
PipeSource
Deprecated.
PipeExtractor (Deprecated since v1.3.0, renamed to PipeSource)
PipeExtractor is responsible for capturing Events from sources.
Various data sources can be supported by implementing different PipeExtractor classes.
The lifecycle of a PipeExtractor is as follows:
- When a collaboration task is created, the KV pairs of `WITH EXTRACTOR` clause in SQL are
parsed and the validation method
validate(PipeParameterValidator)will be called to validate thePipeParameters. - Before the collaboration task starts, the method
customize(PipeParameters, PipeExtractorRuntimeConfiguration)will be called to config the runtime behavior of thePipeExtractor. - Then the method
start()will be called to start thePipeExtractor. - While the collaboration task is in progress, the method
supply()will be called to captureEvents from sources and then theEvents will be passed to thePipeProcessor. - The method
AutoCloseable.close()will be called when the collaboration task is cancelled (the `DROP PIPE` command is executed).
-
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(PipeParameters parameters, PipeExtractorRuntimeConfiguration configuration) Deprecated.This method is mainly used to customizePipeExtractor.voidstart()Deprecated.Start thePipeExtractor.supply()Deprecated.voidvalidate(PipeParameterValidator validator) Deprecated.This method is mainly used to validatePipeParametersand it is executed beforecustomize(PipeParameters, PipeExtractorRuntimeConfiguration)is called.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
validate
Deprecated.This method is mainly used to validatePipeParametersand it is executed beforecustomize(PipeParameters, PipeExtractorRuntimeConfiguration)is called.- Parameters:
validator- the validator used to validatePipeParameters- Throws:
Exception- if anyPipeParametersis not valid
-
customize
void customize(PipeParameters parameters, PipeExtractorRuntimeConfiguration configuration) throws Exception Deprecated.This method is mainly used to customizePipeExtractor. In this method, the user can do the following things:- Use
PipeParametersto parse key-value pair attributes entered by the user. - Set the running configurations in
PipeExtractorRuntimeConfiguration.
This method is called after the method
validate(PipeParameterValidator)is called.- Parameters:
parameters- used to parse the inputPipeParametersentered by the userconfiguration- used to set the required properties of the runningPipeExtractor- Throws:
Exception- the user can throw errors if necessary
- Use
-
start
Deprecated.Start thePipeExtractor. After this method is called,Events should be ready to be supplied bysupply(). This method is called aftercustomize(PipeParameters, PipeExtractorRuntimeConfiguration)is called.- Throws:
Exception- the user can throw errors if necessary
-
supply
Deprecated.Supply singleEventfrom thePipeExtractorand the caller will send theEventto thePipeProcessor. This method is called afterstart()is called.- Returns:
- the
Eventto be supplied. theEventmay benullif thePipeExtractorhas no moreEvents at the moment, but thePipeExtractoris still running for moreEvents. - Throws:
Exception- the user can throw errors if necessary
-