morningman opened a new pull request, #66407:
URL: https://github.com/apache/doris/pull/66407

   ### What problem does this PR solve?
   
   Problem Summary:
   
   The connector plugin contract was split across two modules whose names were
   inverted relative to common usage: `fe-connector-api` held the types a plugin
   IMPLEMENTS (`Connector`, `ConnectorMetadata` and its Ops sub-interfaces, the
   scan / write / procedure providers, handles, pushdown and ddl value types) —
   which is what "SPI" normally names — while `fe-connector-spi` held mostly the
   engine services a plugin CONSUMES (`ConnectorContext`, 
`ConnectorStorageContext`,
   `ConnectorConf`), which is what "API" normally names. Both modules' 
package-info
   already documented the inversion and asked readers to "read the content, not 
the
   name". The `fe-connector-metastore-api` / `-metastore-spi` pair right next to
   them follows the opposite (standard) convention, so one directory carried two
   contradictory naming rules.
   
   Swapping the two names does not fix it. A strict split by "who implements" is
   circular: `ConnectorProvider.create` takes a `ConnectorContext` (spi -> api),
   while `ConnectorContext.createSiblingConnector` returns a `Connector`
   (api -> spi). That cycle is exactly why Trino keeps its whole plugin surface 
in
   a single `trino-spi` module, and this framework is modelled on Trino.
   
   This commit does the same: `fe-connector-api` is merged into
   `fe-connector-spi`, and `org.apache.doris.connector.api` becomes
   `org.apache.doris.connector.spi`. The merge is dependency-neutral — every 
module
   that depended on `fe-connector-api` (hive, hudi, maxcompute, paimon, trino,
   fe-core) already depended on `fe-connector-spi` as well.
   
   Two consequences worth calling out:
   
   - The connector plugin API version is bumped 2.0 -> 3.0. Every type on the
     contract changed its fully-qualified name, so a plugin built against 2.0 
must
     be refused by `ApiVersionGate` at load time rather than fail later with
     `NoClassDefFoundError`. Both recorded baselines
     (`connector-metadata-methods.txt`, `connector-plugin-surface.txt`) and the
     version pinned in `ConnectorPluginSurfaceTest` are updated in this commit.
   - `ChildFirstClassLoader.DEFAULT_PARENT_FIRST_PACKAGES` listed only
     `org.apache.doris.connector.api.`, so `ConnectorProvider` and
     `ConnectorContext` were not parent-first. After the merge the single
     `org.apache.doris.connector.spi.` entry covers the whole contract.
   
   The merged `package-info.java` keeps the existing Rule 1-7 design rules; 
Rule 4
   now explains why both directions live in one module instead of disclaiming 
the
   inverted names. README.md and AGENTS.md are updated accordingly.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Unit Test
       - Full FE build (74 modules) passes, including fe-core test compilation.
       - Connector module test run (31-module reactor) passes: 1712 cases, 0
         failures, 0 errors.
       - Checkstyle passes across the whole fe reactor.
       - Both architecture gates pass: `check-fe-connector-imports.sh` (plus its
         self-test) and `check-fe-core-metadata-funnel.sh`.
       - No regression test run: this is a pure rename/merge with no behavior
         change.
   - Behavior changed: No
   - Does this need documentation: No
   
   
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to