-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring of SPI #1051
Refactoring of SPI #1051
Conversation
@@ -44,12 +48,15 @@ | |||
|
|||
public class ConnectorManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, if any of the *Manager.add*Manager()
methods fail, you need to remove the mapping from the managers already modified. Otherwise, you can leave the managers in a corrupt state. I suggest the methods be of the shape *Manager.remove*Manager(String connectorId, ConnectoManager expectedManager)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the case with the current code, too. I agree, it should be fixed, but I'd rather do it as separate change. This one already has too much stuff in it.
This is a mostly mind numbing mechanical refactoring, so if there are specific sections you want reviewed in more detail, just ask. Otherwise, looks good |
This is a precursor to splitting the *Handle hierarchy so that connectors don't need to be aware of connector ids
Some tests were incorrectly using MetadataManager.INTERNAL_CONNECTOR_ID
There are now two parallel Handle hierarchies: global vs connector-specific. SPI operates in terms of the connector-specific hierarchy. The engine (analyzer, planner), operates in terms of the global hierarchy. Metadata/SplitManager/etc take care of wrapping and unwrapping calls and routing to the appropriate connector based on the connectorId embedded in the global handles.
…ectors They are all now treated as internal connectors. ConnectorManager is now responsible for installing the information schema metadata when appropriate
LocalQueryRunner was installing the metadata, split manager and data stream provider manually instead of relying on the existing SystemConnector and DualConnectors
merged |
This is a preliminary pull request to simplify the SPI. The goal is to no longer require connectors to have to implement canHandle(...) and test for connectorId, which is repetitive and error prone.
I haven't yet removed the HandleResolvers due to a couple of bugs in Jackson:
FasterXML/jackson-databind#406
FasterXML/jackson-databind#408