You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/02/01 21:14:19 UTC

[GitHub] [ratis-hadoop-projects] adoroszlai opened a new pull request #2: RATIS-1517. Remove core Ratis protos

adoroszlai opened a new pull request #2:
URL: https://github.com/apache/ratis-hadoop-projects/pull/2


   ## What changes were proposed in this pull request?
   
    * Move `Hadoop.proto` to the `ratis-hadoop` submodule and update its POM to compile it.
    * Remove core Ratis protos and `ratis-proto` submodule from this repo.
    * Add missing Mockito dependency, found by trying to run the tests (currently disabled).
   
   https://issues.apache.org/jira/browse/RATIS-1517
   
   ## How was this patch tested?
   
   Temporarily enabled tests to verify compiled classes are usable.
   
   CI:
   https://github.com/adoroszlai/ratis-hadoop-projects/actions/runs/1780584551


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ratis-hadoop-projects] szetszwo merged pull request #2: RATIS-1517. Remove core Ratis protos

Posted by GitBox <gi...@apache.org>.
szetszwo merged pull request #2:
URL: https://github.com/apache/ratis-hadoop-projects/pull/2


   


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ratis-hadoop-projects] adoroszlai commented on pull request #2: RATIS-1517. Remove core Ratis protos

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #2:
URL: https://github.com/apache/ratis-hadoop-projects/pull/2#issuecomment-1027690250


   Thanks @szetszwo for reviewing and committing it.


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ratis-hadoop-projects] szetszwo commented on a change in pull request #2: RATIS-1517. Remove core Ratis protos

Posted by GitBox <gi...@apache.org>.
szetszwo commented on a change in pull request #2:
URL: https://github.com/apache/ratis-hadoop-projects/pull/2#discussion_r797328072



##########
File path: ratis-hadoop/pom.xml
##########
@@ -100,24 +110,98 @@
       <plugin>
         <groupId>org.xolstice.maven.plugins</groupId>
         <artifactId>protobuf-maven-plugin</artifactId>
-        <configuration>
-          <protocArtifact>
-            com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
-          </protocArtifact>
-          <!-- Place these in a location that compiler-plugin is already looking -->
-          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
-          <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
-          <clearOutputDirectory>false</clearOutputDirectory>
-        </configuration>
         <executions>
           <execution>
-            <id>compile-protobuf</id>
+            <id>compile-protobuf-2</id>
             <phase>generate-sources</phase>
             <goals>
               <goal>compile</goal>
             </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>HadoopCompatability.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-protobuf-3</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-grpc</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile-custom</goal>
+            </goals>
+            <configuration>
+              <pluginId>grpc-java</pluginId>
+              <pluginArtifact>
+                io.grpc:protoc-gen-grpc-java:${shaded.grpc.version}:exe:${os.detected.classifier}
+              </pluginArtifact>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Modify the generated source to use our shaded protobuf -->
+      <plugin>
+        <groupId>com.google.code.maven-replacer-plugin</groupId>
+        <artifactId>replacer</artifactId>
+        <version>1.5.3</version>
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>replace</goal>
+            </goals>
           </execution>
         </executions>
+        <configuration>
+          <basedir>${project.build.directory}/generated-sources</basedir>
+          <includes>
+            <include>**/grpc-java/**/*.java</include>

Review comment:
       We should remove this include for grpc-java.

##########
File path: ratis-hadoop/pom.xml
##########
@@ -100,24 +110,98 @@
       <plugin>
         <groupId>org.xolstice.maven.plugins</groupId>
         <artifactId>protobuf-maven-plugin</artifactId>
-        <configuration>
-          <protocArtifact>
-            com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
-          </protocArtifact>
-          <!-- Place these in a location that compiler-plugin is already looking -->
-          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
-          <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
-          <clearOutputDirectory>false</clearOutputDirectory>
-        </configuration>
         <executions>
           <execution>
-            <id>compile-protobuf</id>
+            <id>compile-protobuf-2</id>
             <phase>generate-sources</phase>
             <goals>
               <goal>compile</goal>
             </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>HadoopCompatability.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-protobuf-3</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-grpc</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile-custom</goal>
+            </goals>
+            <configuration>
+              <pluginId>grpc-java</pluginId>
+              <pluginArtifact>
+                io.grpc:protoc-gen-grpc-java:${shaded.grpc.version}:exe:${os.detected.classifier}
+              </pluginArtifact>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- Modify the generated source to use our shaded protobuf -->
+      <plugin>
+        <groupId>com.google.code.maven-replacer-plugin</groupId>
+        <artifactId>replacer</artifactId>
+        <version>1.5.3</version>
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>replace</goal>
+            </goals>
           </execution>
         </executions>
+        <configuration>
+          <basedir>${project.build.directory}/generated-sources</basedir>
+          <includes>
+            <include>**/grpc-java/**/*.java</include>
+            <include>**/HadoopProtos.java</include>
+          </includes>
+          <replacements>
+            <replacement>
+              <token>([^\.])com.google</token>
+              <value>$1org.apache.ratis.thirdparty.com.google</value>
+            </replacement>
+            <replacement>
+              <token>([^\.])io.grpc</token>
+              <value>$1org.apache.ratis.thirdparty.io.grpc</value>
+            </replacement>

Review comment:
       We should also remove this grpc replacement.

##########
File path: ratis-hadoop/pom.xml
##########
@@ -100,24 +110,98 @@
       <plugin>
         <groupId>org.xolstice.maven.plugins</groupId>
         <artifactId>protobuf-maven-plugin</artifactId>
-        <configuration>
-          <protocArtifact>
-            com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
-          </protocArtifact>
-          <!-- Place these in a location that compiler-plugin is already looking -->
-          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
-          <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
-          <clearOutputDirectory>false</clearOutputDirectory>
-        </configuration>
         <executions>
           <execution>
-            <id>compile-protobuf</id>
+            <id>compile-protobuf-2</id>
             <phase>generate-sources</phase>
             <goals>
               <goal>compile</goal>
             </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${hadoop.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>HadoopCompatability.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-protobuf-3</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+            <configuration>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- Place these in a location that compiler-plugin is already looking -->
+              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>
+          <execution>
+            <id>compile-grpc</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>compile-custom</goal>
+            </goals>
+            <configuration>
+              <pluginId>grpc-java</pluginId>
+              <pluginArtifact>
+                io.grpc:protoc-gen-grpc-java:${shaded.grpc.version}:exe:${os.detected.classifier}
+              </pluginArtifact>
+              <protocArtifact>
+                com.google.protobuf:protoc:${shaded.protobuf.version}:exe:${os.detected.classifier}
+              </protocArtifact>
+              <includes>
+                <include>Hadoop.proto</include>
+              </includes>
+              <!-- With multiple executions, this must be `false` otherwise we wipe out the previous execution -->
+              <clearOutputDirectory>false</clearOutputDirectory>
+            </configuration>
+          </execution>

Review comment:
       >compile-grpc can be removed.




-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org