yandrey321 opened a new pull request, #12007:
URL: https://github.com/apache/ozone/pull/12007

   ## What changes were proposed in this pull request?
   
   **Problem:** HDDS-15342 made the default of 
`ozone.om.compaction.service.bottommost-level-compaction` in `OMConfigKeys` a 
RocksDB enum, and added `rocksdbjni` to `ozone-common` at compile scope so that 
it compiles. `ozone-common` is a client dependency, so every client artifact 
now ships RocksDB, with native libraries for 15 platforms. The shaded 
`ozone-filesystem-hadoop3` jar grew from 68.8 MB in 2.2.0 to 155 MB, even 
though no client code uses RocksDB. MapReduce and Spark jobs ship this jar to 
every container.
   
   **Implementation idea:**
   - Make the default the string `"kSkip"`, which is the same value as in 
`ozone-default.xml`.
   - `CompactDBUtil.getBottommostLevelCompaction` in `ozone-manager`, which 
already depends on RocksDB, parses it into the enum.
   - Remove `rocksdbjni` from `hadoop-ozone/common/pom.xml`.
   - Remove the `allowedImport` for 
`org.rocksdb.CompactRangeOptions.BottommostLevelCompaction`, which HDDS-15342 
added only for this constant.
   - Add a `ban-rocksdb` enforcer rule (`bannedDependencies`, which includes 
transitive dependencies), so RocksDB can't come back unnoticed.
   
   **Key decisions:**
   - The rule is defined once in the root POM, next to `ban-aws-sdk-v1`, and is 
skipped by default through `ban-rocksdb.skip`. It is enabled in `ozone-common`, 
`ozone-client`, `ozone-filesystem-common`, `ozone-filesystem`, 
`ozone-filesystem-shaded`, `ozone-filesystem-hadoop2` and 
`ozone-filesystem-hadoop3`. This is the same pattern as `classpath.skip`.
   - The rule is not enabled on the shared `hdds-hadoop-dependency-client` 
parent, because `ozone-cli-admin` uses that parent and gets RocksDB 
legitimately through `hdds-server-framework`.
   - A check on the shaded jar's contents was rejected. It would run only when 
shading is enabled, and it would fail later and less clearly than the enforcer.
   
   **Side effects:**
   - `OZONE_OM_COMPACTION_SERVICE_BOTTOMMOSTLEVELCOMPACTION_DEFAULT` changes 
type from `BottommostLevelCompaction` to `String`. HDDS-15342 is not in any 
release, so no released API changes.
   - Configuration behavior does not change. Unset or invalid values still fall 
back to `kSkip`.
   - Client jars no longer contain RocksDB. Client code never used it.
   
   Co-authored-by: Claude Opus 5.5 <[email protected]>
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17772
   
   ## How was this patch tested?
   
   Unit + integration tests.
   
   - **Jar contents and size** (local builds):
   
   | `ozone-filesystem-hadoop3` | size | `org/rocksdb` classes | 
`librocksdbjni` files |
   |---|---|---|---|
   | 2.2.0 | 68.8 MB | 0 | 0 |
   | master | 155.0 MB | 253 | 15 platforms |
   | this PR | 71.0 MB | 0 | 0 |
   
     This PR removes 84 MB from the jar. That is all of the RocksDB content, 
which was nearly all of the growth since 2.2.0. The remaining 2.2 MB comes from 
other changes since 2.2.0.
   


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