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/02 07:23:28 UTC

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

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