Make the creation of customized connector and the connector builder integration easier
qxzzxq opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
Until the current version, we can only use ConnectorBuilder
to build connectors that are already defined in Setl (the storage type must be in the enum Storage
). In addition, two specific constructors have to be defined so that the ConnectorBuilder
can invoke them to instantiate the corresponding connector. As the constructor cannot be inherited, users who have less knowledge of Setl cannot easily implement their own connector. This makes the API of connector builder not extensible.
I'd like to re-think about the API of the connector. The goal is to make the creation of a customized connector easier.
Describe the solution you'd like
The following is just a personal reminder, to be discussed.
As the constructor could not be inherited, maybe it's better to replace the mandatory constructors by setter methods.
As for the instantiation in ConnectorBuilder
, we may add the following logic in buildConnectorWithConf
:
- if the storage is a pre-defined storage type (ex, CSV), then we follow the current implementation.
- when the storage is of type OTHER, then look for a field in the configuration called "class", where user should give the complete class reference, for example,
com.example.projcet.MyCustomizedConnector
We will have to rewrite the current connectors. But these changes should not affect the usage of Setl.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
wip