Pipe: Load TsFile classes from parent class loader - #18578
Open
Caideyipi wants to merge 1 commit into
Open
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem
PipePluginClassLoaderuses child-first loading for external plugin dependencies, while delegating shared API packages to the parent class loader. TsFile classes are also exposed by the Pipe API boundary, for exampleTabletInsertionEvent#processTabletpasses anorg.apache.tsfile.write.record.Tabletto plugin code.If an external plugin bundles TsFile, the plugin class loader currently loads a second copy of
Tablet. A core-createdTabletcan then fail with a same-class-nameClassCastExceptionbecause the two copies have different class loaders, preventing the sink from processing events.Fix
Add
org.apache.tsfile.to the parent-first package prefixes. This keeps TsFile types shared across the Pipe API boundary while preserving child-first loading for ordinary plugin implementation classes and dependencies.Test
Add a regression test that creates a plugin JAR containing a duplicate fake
org.apache.tsfile.write.record.Tablet, then verifies that the plugin class loader resolves the parent TsFile class. The existing test continues to verify child-first loading for normal plugin classes.Tested with:
./mvnw -pl iotdb-core/node-commons -Dtest=PipePluginClassLoaderTest -DskipITs testThis PR has:
Key changed/added classes
PipePluginClassLoaderPipePluginClassLoaderTest