Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Refactoring of SPI #1051

wants to merge 8 commits into from

Conversation

martint
Copy link
Contributor

@martint martint commented Feb 16, 2014

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

@@ -44,12 +48,15 @@

public class ConnectorManager
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@dain
Copy link
Contributor

dain commented Feb 16, 2014

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

@dain dain assigned jamesgpearce and martint and unassigned jamesgpearce Feb 25, 2014
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
@martint
Copy link
Contributor Author

martint commented Apr 27, 2014

merged

@martint martint closed this Apr 27, 2014
@martint martint deleted the connector branch April 29, 2014 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants