linghengqian commented on issue #21503: URL: https://github.com/apache/shardingsphere/issues/21503#issuecomment-1275555937
- `shardingAlgorithm` will use the metadata of `ContextManager`, but you have to consider that it is easy to have a little misunderstanding, all algorithm classes should be `final classes` or close to `final classes` in design. This means that if you directly return the `shardingAlgorithm` class of the original metadata to the new metadata class, the `init()` function commonly used by subinterfaces of `shardingAlgorithm` will not be called. This means that you need to manually build a new `shardingAlgorithm` and explicitly call the `init()` function to initialize some of the internal properties you need. This is actually the underlying manifestation of `ShardingSphere JDBC`, and this step is handled by another listener when `DistSQL` is executed. - This is indeed a big black box, because each version of the `ContextManager` is designed a little differently. 🤣 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
