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

   ## What changes were proposed in this pull request?
   Migrate gRPC transport to the Ratis-shaded gRPC/Netty/Protobuf stack
   
   ## Summary
   Migrates Ozone's gRPC transport layer from the standalone `io.grpc` / 
`io.netty` / `com.google.protobuf`
   libraries to the Ratis-shaded equivalents (`org.apache.ratis.thirdparty.*`), 
eliminating duplicate copies
   of these libraries on the classpath and resolving version conflicts with 
Ratis at runtime.
   Zero-copy marshalling is preserved: all generated stubs use the shaded 
`MessageLite`-based
   `ProtoUtils.marshaller()` from `ratis-thirdparty`.
   ---
   ### New modules
   | Module | Artifact | Purpose |
   |---|---|---|
   | `hadoop-hdds/datanode-grpc-client` | `hdds-datanode-grpc-client` | Owns 
`DatanodeClientProtocol.proto`; generates shaded gRPC stubs for 
Datanode/Container RPC |
   | `hadoop-hdds/scm-grpc-client` | `hdds-scm-grpc-client` | Owns 
`InterSCMProtocol.proto`, `SCMRatisProtocol.proto`, `SCMUpdateProtocol.proto`; 
generates shaded gRPC stubs for inter-SCM and SCM-Ratis RPC |
   Both modules use `protobuf-maven-plugin` to generate Java from the proto 
files and then
   `maven-antrun-plugin` to rewrite the generated sources **in-place** before 
compilation:
   com.google.protobuf → org.apache.ratis.thirdparty.com.google.protobuf 
com.google.common → org.apache.ratis.thirdparty.com.google.common io.grpc → 
org.apache.ratis.thirdparty.io.grpc
   
   Generating directly into the shaded source root 
(`target/generated-sources/proto-java-ratis/`)
   ensures both Maven and the IDE compile from the same tree, preventing 
stale-class interference.
   ---
   ### Proto file migrations
   | File | Moved from | Moved to |
   |---|---|---|
   | `DatanodeClientProtocol.proto` | `hdds-interface-client` | 
`hdds-datanode-grpc-client` |
   | `InterSCMProtocol.proto` | `hdds-interface-server` | 
`hdds-scm-grpc-client` |
   | `SCMRatisProtocol.proto` | `hdds-interface-server` | 
`hdds-scm-grpc-client` |
   | `SCMUpdateProtocol.proto` | `hdds-interface-server` | 
`hdds-scm-grpc-client` |
   `proto.lock` files updated in all four affected modules.
   ---
   ### Source changes — `io.grpc` → shaded imports
   | File | Change |
   |---|---|
   | `hadoop-ozone/common` — `GrpcOmTransport`, `GrpcOMFailoverProxyProvider`, 
`ClientAddressClientInterceptor`, `ClientAddressServerInterceptor`, 
`GrpcClientConstants` | All `io.grpc.*` replaced with 
`org.apache.ratis.thirdparty.io.grpc.*` |
   | `hadoop-ozone/ozone-manager` — `GrpcOzoneManagerServer`, 
`OzoneManagerServiceGrpc` | Same migration |
   | `hadoop-hdds/framework` — `GrpcMetricsServerRequestInterceptor`, 
`GrpcMetricsServerResponseInterceptor`, `GrpcMetricsServerTransportFilter` | 
Same migration |
   | `hadoop-ozone/csi` — `CsiServer`, `ControllerService`, `IdentityService`, 
`NodeService` | Same migration |
   | `hadoop-hdds/common` — `HddsUtils` | `ByteString` usage aligned with 
shaded protobuf |
   All corresponding test files updated to match.
   ---
   ### Build changes
   #### Root `pom.xml`
   - `hdds-datanode-grpc-client` and `hdds-scm-grpc-client` added to 
`<dependencyManagement>` and
     dependency-analysis ignore lists.
   - Four new `maven-antrun-plugin` executions added globally (inherited by 
every module):
     | Execution | Phase | Purpose |
     |---|---|---|
     | `pre-clean-force-delete-target` | `pre-clean` | Uses `/bin/rm -rf` to 
delete `target/` before `maven-clean-plugin` runs, working around macOS 
`com.apple.provenance` extended attributes that prevent 
`java.nio.file.Files.delete()` from removing IDE-written class files |
     | `pre-compile-delete-classes` | `process-resources` | Deletes stale 
`.class` files from the current module, then restores `hdds-common`, 
`hdds-datanode-grpc-client`, and `hdds-scm-grpc-client` from their installed 
`.m2/` JARs to prevent Java Language Server corruption of dependency class 
files during reactor builds |
     | `pre-test-compile-refresh-classes` | `process-test-resources` | Same 
foundation-module refresh before `test-compile`, closing the LSP interference 
window between `compile` and `test-compile` within a single module lifecycle |
     | `pre-verify-refresh-classes-from-jar` | `pre-integration-test` | 
Repopulates `target/classes/` from the module's own freshly-built JAR before 
`dependency:analyze-only` runs at `verify` |
   - `pre-verify-delete-test-classes` execution phase corrected from 
`prepare-package` to
     `pre-integration-test`, fixing a bug where test-jars were being packaged 
empty (compiled
     test classes were deleted before `maven-jar-plugin:test-jar` could include 
them).
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-14949
   
   ## How was this patch tested?
   
   Build, unit and integration tests


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