You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.add connector info to plugin-mapping.properties file in seatunnel root path.
57
56
58
57
5.add connector dependency to seatunnel-dist/pom.xml, so the connector jar can be find in binary package.
59
58
59
+
6.There are several classes that must be implemented on the source side, namely {ConnectorName}Source, {ConnectorName}SourceFactory, {ConnectorName}SourceReader; There are several classes that must be implemented on the sink side, namely {ConnectorName}Sink, {ConnectorName}SinkFactory, {ConnectorName}SinkWriter Please refer to other connectors for details
60
+
61
+
7.{ConnectorName}SourceFactory and {ConnectorName}SinkFactory needs to be annotated with the **@AutoService (Factory.class)** annotation on the class name, and in addition to the required methods, source side an additional **creatSource** method needs to be rewritten and sink side an additional **creatSink** method needs to be rewritten
62
+
63
+
8.{ConnectorName}Source needs to override the **getProducedCatalogTables** method; {ConnectorName}Sink needs to override the **getWriteCatalogTable** method
64
+
60
65
### **Startup Class**
61
66
62
67
Aside from the old startup class, we have created two new startup modules,
@@ -205,26 +210,25 @@ In order to automatically create the Source Connector and Sink Connector and Tra
205
210
supported by the current connector and the required parameters. We define TableSourceFactory and TableSinkFactory,
206
211
It is recommended to put it in the same directory as the implementation class of SeaTunnelSource or SeaTunnelSink for easy searching.
207
212
208
-
-`factoryIdentifier` is used to indicate the name of the current Factory. This value should be the same as the
209
-
value returned by `getPluginName`, so that if Factory is used to create Source/Sink in the future,
210
-
A seamless switch can be achieved.
211
-
-`createSink` and `createSource` are the methods for creating Source and Sink respectively,
212
-
and do not need to be implemented at present.
213
+
-`factoryIdentifier` is used to indicate the name of the current Factory. This value should be the same as the
214
+
value returned by `getPluginName`, so that if Factory is used to create Source/Sink in the future,
215
+
A seamless switch can be achieved.
216
+
-`createSink` and `createSource` are the methods for creating Source and Sink respectively.
213
217
-`optionRule` returns the parameter logic, which is used to indicate which parameters of our connector are supported,
214
-
which parameters are required, which parameters are optional, and which parameters are exclusive, which parameters are bundledRequired.
215
-
This method will be used when we visually create the connector logic, and it will also be used to generate a complete parameter
216
-
object according to the parameters configured by the user, and then the connector developer does not need to judge whether the parameters
217
-
exist one by one in the Config, and use it directly That's it.
218
-
You can refer to existing implementations, such as `org.apache.seatunnel.connectors.seatunnel.elasticsearch.source.ElasticsearchSourceFactory`.
219
-
There is support for configuring Schema for many Sources, so a common Option is used.
220
-
If you need a schema, you can refer to `org.apache.seatunnel.api.table.catalog.CatalogTableUtil.SCHEMA`.
218
+
which parameters are required, which parameters are optional, and which parameters are exclusive, which parameters are bundledRequired.
219
+
This method will be used when we visually create the connector logic, and it will also be used to generate a complete parameter
220
+
object according to the parameters configured by the user, and then the connector developer does not need to judge whether the parameters
221
+
exist one by one in the Config, and use it directly That's it.
222
+
You can refer to existing implementations, such as `org.apache.seatunnel.connectors.seatunnel.elasticsearch.source.ElasticsearchSourceFactory`.
223
+
There is support for configuring Schema for many Sources, so a common Option is used.
224
+
If you need a schema, you can refer to `org.apache.seatunnel.api.table.catalog.CatalogTableUtil.SCHEMA`.
221
225
222
226
Don't forget to add `@AutoService(Factory.class)` to the class. This Factory is the parent class of TableSourceFactory and TableSinkFactory.
223
227
224
228
### **Options**
225
229
226
230
When we implement TableSourceFactory and TableSinkFactory, the corresponding Option will be created.
227
-
Each Option corresponds to a configuration, but different configurations will have different types.
231
+
Each Option corresponds to a configuration, but different configurations will have different types.
228
232
Common types can be created by directly calling the corresponding method.
229
233
But if our parameter type is an object, we can use POJO to represent parameters of object type,
230
234
and need to use `org.apache.seatunnel.api.configuration.util.OptionMark` on each parameter to indicate that this is A child Option.
@@ -237,6 +241,4 @@ please refer to `org.apache.seatunnel.connectors.seatunnel.assertion.sink.Assert
237
241
## **Result**
238
242
239
243
All Connector implementations should be under the ``seatunnel-connectors-v2``, and the examples that can be referred to
0 commit comments