Package org.apache.iotdb.pipe.api
Interface PipeConnector
- All Superinterfaces:
AutoCloseable,PipePlugin
- All Known Subinterfaces:
PipeSink
Deprecated.
PipeConnector (Deprecated since v1.3.0, renamed to PipeSink)
PipeConnector is responsible for sending Events to sinks.
Various network protocols can be supported by implementing different PipeConnector
classes.
The lifecycle of a PipeConnector is as follows:
- When a collaboration task is created, the KV pairs of `WITH CONNECTOR` clause in SQL are
parsed and the validation method
validate(PipeParameterValidator)will be called to validate the parameters. - Before the collaboration task starts, the method
customize(PipeParameters, PipeConnectorRuntimeConfiguration)will be called to config the runtime behavior of thePipeConnectorand the methodhandshake()will be called to create a connection with sink. - While the collaboration task is in progress:
PipeExtractorcaptures theEvents and wraps them into three types ofEventinstances.PipeProcessorprocesses theEventand then passes them to thePipeConnector.PipeConnectorserializes theEvents into binaries and send them to sinks. The following 3 methods will be called:transfer(TabletInsertionEvent),transfer(TsFileInsertionEvent)andtransfer(Event).
- When the collaboration task is cancelled (the `DROP PIPE` command is executed), the
AutoCloseable.close()method will be called.
In addition, the method heartbeat() will be called periodically to check
whether the connection with sink is still alive. The method handshake()
will be called to create a new connection with the sink when the method heartbeat() throws exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(PipeParameters parameters, PipeConnectorRuntimeConfiguration configuration) Deprecated.This method is mainly used to customizePipeConnector.voidDeprecated.This method is used to create a connection with sink.voidDeprecated.This method will be called periodically to check whether the connection with sink is still alive.voidtransfer(TabletInsertionEvent tabletInsertionEvent) Deprecated.This method is used to transfer theTabletInsertionEvent.default voidtransfer(TsFileInsertionEvent tsFileInsertionEvent) Deprecated.This method is used to transfer theTsFileInsertionEvent.voidDeprecated.This method is used to transfer genericEvents.voidvalidate(PipeParameterValidator validator) Deprecated.This method is mainly used to validatePipeParametersand it is executed beforecustomize(PipeParameters, PipeConnectorRuntimeConfiguration)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, PipeConnectorRuntimeConfiguration)is called.- Parameters:
validator- the validator used to validatePipeParameters- Throws:
Exception- if any parameter is not valid
-
customize
void customize(PipeParameters parameters, PipeConnectorRuntimeConfiguration configuration) throws Exception Deprecated.This method is mainly used to customizePipeConnector. 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
PipeConnectorRuntimeConfiguration.
This method is called after the method
validate(PipeParameterValidator)is called and before the methodhandshake()is called.- Parameters:
parameters- used to parse the inputPipeParametersentered by the userconfiguration- used to set the required properties of the runningPipeConnector- Throws:
Exception- the user can throw errors if necessary
- Use
-
handshake
Deprecated.This method is used to create a connection with sink. This method will be called after the methodcustomize(PipeParameters, PipeConnectorRuntimeConfiguration)is called or will be called when the methodheartbeat()throws exceptions.- Throws:
Exception- if the connection is failed to be created
-
heartbeat
Deprecated.This method will be called periodically to check whether the connection with sink is still alive.- Throws:
Exception- if the connection dies
-
transfer
Deprecated.This method is used to transfer theTabletInsertionEvent.- Parameters:
tabletInsertionEvent-TabletInsertionEventto be transferred- Throws:
PipeConnectionException- if the connection is brokenException- the user can throw errors if necessary
-
transfer
Deprecated.This method is used to transfer theTsFileInsertionEvent.- Parameters:
tsFileInsertionEvent-TsFileInsertionEventto be transferred- Throws:
PipeConnectionException- if the connection is brokenException- the user can throw errors if necessary
-
transfer
Deprecated.This method is used to transfer genericEvents.- Parameters:
event-Eventto be transferred- Throws:
PipeConnectionException- if the connection is brokenException- the user can throw errors if necessary
-