xiangfu0 commented on code in PR #19448:
URL: https://github.com/apache/pinot/pull/19448#discussion_r4646213200
##########
pom.xml:
##########
@@ -3083,75 +3212,75 @@
<relocations>
<relocation>
<pattern>org.apache.hadoop.shaded.com.fasterxml.jackson.core</pattern>
-
<shadedPattern>${shade.prefix}.com.fasterxml.jackson.core</shadedPattern>
+ <shadedPattern>${shade.jackson.prefix}.core</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hadoop.shaded.com.fasterxml.jackson.databind</pattern>
-
<shadedPattern>${shade.prefix}.com.fasterxml.jackson.databind</shadedPattern>
+ <shadedPattern>${shade.jackson.prefix}.databind</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hadoop.shaded.com.fasterxml.jackson.annotation</pattern>
-
<shadedPattern>${shade.prefix}.com.fasterxml.jackson.annotation</shadedPattern>
+ <shadedPattern>${shade.jackson.prefix}.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>com.facebook.presto.jdbc.internal.jackson</pattern>
-
<shadedPattern>${shade.prefix}.com.fasterxml.jackson</shadedPattern>
+ <shadedPattern>${shade.jackson.prefix}</shadedPattern>
</relocation>
<relocation>
<pattern>software.amazon.awssdk.thirdparty.jackson.core</pattern>
-
<shadedPattern>${shade.prefix}.com.fasterxml.jackson.core</shadedPattern>
+ <shadedPattern>${shade.jackson.prefix}.core</shadedPattern>
Review Comment:
Some more detail on this one from scanning the whole thin distribution built
at this commit. I checked every member reference between classes served from
`lib/pinot-all` and classes that only exist under `plugins/` and
`plugin-libs/`, in both directions, for descriptors that carry one of the
rewritten namespaces. Exactly two don't resolve, both from `aws-json-protocol`
into `json-utils`:
```
JsonNodeParser$Builder.jsonFactory(Lsoftware/amazon/awssdk/thirdparty/jackson/core/JsonFactory;)
JsonValueNodeFactory.node(Lsoftware/amazon/awssdk/thirdparty/jackson/core/JsonParser;Lsoftware/amazon/awssdk/thirdparty/jackson/core/JsonToken;)
```
The first is called from two classes, `JsonContent` among them, and the
second from `JsonUnmarshallingParser`, so I wouldn't assume this is limited to
error responses. The Hadoop, Curator and Parquet boundaries came back clean,
even though `pinot-all` also carries rewritten Hadoop MapReduce/YARN and
Curator classes next to an untouched `hadoop-common` in `plugin-libs/`.
The SDK is in the thin `pinot-all` at all because `pinot-tools` declares
`software.amazon.awssdk:sdk-core` and `s3` directly, and nothing under
`pinot-tools/src/main/java` imports them. That pulls about 30 SDK jars into
`pinot-all`, `json-utils` included, while Kinesis gets `aws-json-protocol` from
`plugin-libs/`. Excluding `software.amazon.awssdk` from `pinot-tools` in the
thin profile, next to the 13 plugins, or dropping those two dependencies, would
put the whole SDK on one side of the boundary.
##########
pinot-distribution/pom.xml:
##########
@@ -168,6 +169,90 @@
</build>
</profile>
+ <profile>
+ <!--
+ Thin plugin layout; see the thin-plugins profile in the root pom.
Builds the binary
+ distribution from pinot-assembly-thin.xml, which ships each plugin as
its own jar plus a
+ pinot-plugin.classpath index into the shared plugin-libs/ store.
+
+ It also keeps plugins out of lib/pinot-all.jar. pinot-tools depends on
plugin modules, so
+ without these exclusions the uber-jar would carry each of them a
second time, and that copy
+ would win on the classpath over the one under plugins/. Only plugins
pinot-tools never
+ references at compile time are excluded: it imports classes from
pinot-avro, pinot-json,
+ pinot-parquet and pinot-minion-builtin-tasks, so those stay. A plugin
may only be excluded
+ here if pinot-assembly-thin.xml ships it under plugins/, otherwise it
disappears from the
+ distribution instead of moving; that is why pinot-compound-metrics
stays.
+
+ Declaring these dependencies `provided` in pinot-tools would keep the
list next to what it
+ describes, but `provided` is not on the runtime classpath, so
quickstarts launched from
+ Maven or an IDE, where there is no plugins/ directory, would lose
these plugins.
+ -->
+ <id>thin-plugins</id>
+ <properties>
+ <bin.dist.descriptor>pinot-assembly-thin.xml</bin.dist.descriptor>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-tools</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-kafka-4.0</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-kinesis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-pulsar</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-batch-ingestion-standalone</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-s3</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-confluent-avro</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-csv</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-protobuf</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-bson</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-orc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-thrift</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.pinot</groupId>
+ <artifactId>pinot-yammer</artifactId>
Review Comment:
Excluding the metrics plugins from `pinot-all` changes what
`PLUGINS_INCLUDE` means. In the default layout `pinot-all` already carries
everything `pinot-tools` depends on (yammer, dropwizard, csv, json, s3, kafka
and so on), so `PLUGINS_INCLUDE=pinot-s3` adds to that set. In the thin layout
it becomes an exact allowlist, and since no component starts without a metrics
factory, any selection that doesn't name `pinot-yammer` fails at startup.
I checked this on the thin distribution built from this commit. With the
classpath the launcher produces for `PLUGINS_INCLUDE=pinot-s3`, the only
factory found is `CompoundPinotMetricsFactory` and `PinotMetricUtils.init`
throws:
```
java.lang.IllegalStateException: Failed to initialize PinotMetricsFactory.
Please check if any pinot-metrics related jar is actually added to the
classpath.
```
Without a selection it finds all three factories and initializes fine. I'd
keep `pinot-yammer` and `pinot-dropwizard` in `pinot-all` here (they're tiny),
or have the launcher always add the metrics plugins. Either way the description
should call out that a selection now has to list every plugin the deployment
uses, including the input formats and `pinot-batch-ingestion-standalone` that
used to come along with `pinot-all`.
##########
.github/workflows/scripts/.pinot_linter.sh:
##########
@@ -31,3 +31,5 @@ mvn -B -ntp -T1C checkstyle:check || exit 1
mvn -B -ntp -T1C spotless:check || exit 1
mvn -B -ntp -T1C enforcer:enforce || exit 1
mvn -B -ntp -T1C enforcer:enforce -Pdependency-verifier || exit 1
+# Plugins built with thin-plugins must not bundle the third-party jars that
pinot-dependency-patches replaces
+mvn -B -ntp -T1C enforcer:enforce@thin-plugin-dependencies -Pthin-plugins ||
exit 1
Review Comment:
This is the only CI coverage the profile gets. Nothing builds or starts a
thin distribution, and `pinot-assembly.xml` and `pinot-assembly-thin.xml` are
kept in sync only by a comment (they do match today, 30 entries each). Since
the plan is for downstream to move first, could we add a cheap parity check
between the two descriptors, and ideally a job that builds
`-Pbin-dist,thin-plugins` and runs the batch quickstart? Otherwise the first
sign of drift will be someone else's build.
--
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]