Skip to content

Commit 2f2e58f

Browse files
TEZ-4715: Migrate Tez PB Protocols from ProtobufRPCEngine to ProtobufRPCEngine2
1 parent 4ffd40f commit 2f2e58f

106 files changed

Lines changed: 300 additions & 258 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codespellrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
[codespell]
21+
ignore-words-list = thirdparty

pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<frontend-maven-plugin.version>1.15.0</frontend-maven-plugin.version>
7878
<guava.version>32.0.1-jre</guava.version>
7979
<hadoop.version>3.4.2</hadoop.version>
80+
<hadoop-thirdparty.version>1.4.0</hadoop-thirdparty.version>
8081
<jersey.version>1.19.4</jersey.version>
8182
<jettison.version>1.5.4</jettison.version>
8283
<jsr305.version>3.0.0</jsr305.version>
@@ -101,6 +102,7 @@
101102
<test.log.dir>${project.build.directory}/logs</test.log.dir>
102103
<wro4j-maven-plugin.version>1.7.9</wro4j-maven-plugin.version>
103104
<maven.javadoc.skip>true</maven.javadoc.skip> <!-- enabled only in relevant modules separately -->
105+
<maven-replacer-plugin.version>1.5.3</maven-replacer-plugin.version>
104106
</properties>
105107
<scm>
106108
<connection>${scm.url}</connection>
@@ -773,6 +775,11 @@
773775
<artifactId>protobuf-java</artifactId>
774776
<version>${protobuf.version}</version>
775777
</dependency>
778+
<dependency>
779+
<groupId>org.apache.hadoop.thirdparty</groupId>
780+
<artifactId>hadoop-shaded-protobuf_3_25</artifactId>
781+
<version>${hadoop-thirdparty.version}</version>
782+
</dependency>
776783
<dependency>
777784
<groupId>com.google.guava</groupId>
778785
<artifactId>guava</artifactId>
@@ -1100,6 +1107,51 @@
11001107
</dependency>
11011108
</dependencies>
11021109
</plugin>
1110+
<plugin>
1111+
<groupId>com.google.code.maven-replacer-plugin</groupId>
1112+
<artifactId>replacer</artifactId>
1113+
<version>${maven-replacer-plugin.version}</version>
1114+
<executions>
1115+
<execution>
1116+
<id>replace-generated-sources</id>
1117+
<phase>generate-sources</phase>
1118+
<goals>
1119+
<goal>replace</goal>
1120+
</goals>
1121+
<configuration>
1122+
<basedir>${project.basedir}</basedir>
1123+
<includes>
1124+
<include>target/generated-sources/**/*.java</include>
1125+
</includes>
1126+
<replacements>
1127+
<replacement>
1128+
<token>([^\.])com.google.protobuf</token>
1129+
<value>$1org.apache.hadoop.thirdparty.protobuf</value>
1130+
</replacement>
1131+
</replacements>
1132+
</configuration>
1133+
</execution>
1134+
<execution>
1135+
<id>replace-generated-test-sources</id>
1136+
<phase>generate-sources</phase>
1137+
<goals>
1138+
<goal>replace</goal>
1139+
</goals>
1140+
<configuration>
1141+
<basedir>${project.basedir}</basedir>
1142+
<includes>
1143+
<include>target/generated-test-sources/**/*.java</include>
1144+
</includes>
1145+
<replacements>
1146+
<replacement>
1147+
<token>([^\.])com.google.protobuf</token>
1148+
<value>$1org.apache.hadoop.thirdparty.protobuf</value>
1149+
</replacement>
1150+
</replacements>
1151+
</configuration>
1152+
</execution>
1153+
</executions>
1154+
</plugin>
11031155
</plugins>
11041156
</pluginManagement>
11051157

tez-api/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
<artifactId>commons-collections4</artifactId>
8383
</dependency>
8484
<dependency>
85-
<groupId>com.google.protobuf</groupId>
86-
<artifactId>protobuf-java</artifactId>
85+
<groupId>org.apache.hadoop.thirdparty</groupId>
86+
<artifactId>hadoop-shaded-protobuf_3_25</artifactId>
8787
</dependency>
8888
<dependency>
8989
<groupId>junit</groupId>
@@ -183,6 +183,10 @@
183183
</execution>
184184
</executions>
185185
</plugin>
186+
<plugin>
187+
<groupId>com.google.code.maven-replacer-plugin</groupId>
188+
<artifactId>replacer</artifactId>
189+
</plugin>
186190
</plugins>
187191
</build>
188192

tez-api/src/main/java/org/apache/tez/client/FrameworkClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.hadoop.classification.InterfaceAudience.Private;
2424
import org.apache.hadoop.conf.Configuration;
2525
import org.apache.hadoop.security.UserGroupInformation;
26+
import org.apache.hadoop.thirdparty.protobuf.ServiceException;
2627
import org.apache.hadoop.yarn.api.records.ApplicationId;
2728
import org.apache.hadoop.yarn.api.records.ApplicationReport;
2829
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
@@ -49,8 +50,6 @@
4950
import org.apache.tez.frameworkplugins.FrameworkUtils;
5051
import org.apache.tez.frameworkplugins.yarn.YarnClientFrameworkService;
5152

52-
import com.google.protobuf.ServiceException;
53-
5453
import org.slf4j.Logger;
5554
import org.slf4j.LoggerFactory;
5655

tez-api/src/main/java/org/apache/tez/client/TezClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.apache.hadoop.fs.Path;
4545
import org.apache.hadoop.security.Credentials;
4646
import org.apache.hadoop.security.UserGroupInformation;
47+
import org.apache.hadoop.thirdparty.protobuf.ServiceException;
4748
import org.apache.hadoop.util.Time;
4849
import org.apache.hadoop.yarn.api.records.ApplicationId;
4950
import org.apache.hadoop.yarn.api.records.ApplicationReport;
@@ -80,7 +81,6 @@
8081
import com.google.common.annotations.VisibleForTesting;
8182
import com.google.common.collect.Maps;
8283
import com.google.common.util.concurrent.ThreadFactoryBuilder;
83-
import com.google.protobuf.ServiceException;
8484

8585
import org.slf4j.Logger;
8686
import org.slf4j.LoggerFactory;

tez-api/src/main/java/org/apache/tez/client/TezClientUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import org.apache.hadoop.fs.permission.FsAction;
5757
import org.apache.hadoop.io.DataOutputBuffer;
5858
import org.apache.hadoop.io.Text;
59-
import org.apache.hadoop.ipc.ProtobufRpcEngine;
59+
import org.apache.hadoop.ipc.ProtobufRpcEngine2;
6060
import org.apache.hadoop.ipc.RPC;
6161
import org.apache.hadoop.net.NetUtils;
6262
import org.apache.hadoop.security.Credentials;
@@ -982,7 +982,7 @@ public static DAGClientAMProtocolBlockingPB getAMProxy(final Configuration conf,
982982
proxy = userUgi.doAs(new PrivilegedExceptionAction<DAGClientAMProtocolBlockingPB>() {
983983
@Override
984984
public DAGClientAMProtocolBlockingPB run() throws IOException {
985-
RPC.setProtocolEngine(conf, DAGClientAMProtocolBlockingPB.class, ProtobufRpcEngine.class);
985+
RPC.setProtocolEngine(conf, DAGClientAMProtocolBlockingPB.class, ProtobufRpcEngine2.class);
986986
return (DAGClientAMProtocolBlockingPB) RPC.getProxy(DAGClientAMProtocolBlockingPB.class,
987987
0, serviceAddr, conf);
988988
}

tez-api/src/main/java/org/apache/tez/common/RPCUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
import java.lang.reflect.InvocationTargetException;
2424

2525
import org.apache.hadoop.ipc.RemoteException;
26+
import org.apache.hadoop.thirdparty.protobuf.ServiceException;
2627
import org.apache.tez.dag.api.DAGNotRunningException;
2728
import org.apache.tez.dag.api.NoCurrentDAGException;
2829
import org.apache.tez.dag.api.SessionNotRunning;
2930
import org.apache.tez.dag.api.TezException;
3031

31-
import com.google.protobuf.ServiceException;
32-
3332
public final class RPCUtil {
3433

3534
private RPCUtil() {}

tez-api/src/main/java/org/apache/tez/common/TezCommonUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@
4444
import org.apache.hadoop.io.DataOutputBuffer;
4545
import org.apache.hadoop.security.Credentials;
4646
import org.apache.hadoop.security.token.Token;
47+
import org.apache.hadoop.thirdparty.protobuf.ByteString;
4748
import org.apache.hadoop.yarn.api.records.LocalResource;
4849
import org.apache.tez.client.TezClient;
4950
import org.apache.tez.common.security.JobTokenIdentifier;
5051
import org.apache.tez.dag.api.TezConfiguration;
5152
import org.apache.tez.dag.api.TezConstants;
5253
import org.apache.tez.dag.api.TezUncheckedException;
5354

54-
import com.google.protobuf.ByteString;
55-
5655
import org.slf4j.Logger;
5756
import org.slf4j.LoggerFactory;
5857

tez-api/src/main/java/org/apache/tez/common/TezUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828

2929
import org.apache.hadoop.classification.InterfaceAudience;
3030
import org.apache.hadoop.conf.Configuration;
31+
import org.apache.hadoop.thirdparty.protobuf.ByteString;
32+
import org.apache.hadoop.thirdparty.protobuf.CodedInputStream;
3133
import org.apache.tez.client.TezClientUtils;
3234
import org.apache.tez.dag.api.TezUncheckedException;
3335
import org.apache.tez.dag.api.UserPayload;
3436
import org.apache.tez.dag.api.records.DAGProtos;
3537
import org.apache.tez.runtime.api.TaskContext;
3638

37-
import com.google.protobuf.ByteString;
38-
import com.google.protobuf.CodedInputStream;
39-
4039
import org.codehaus.jettison.json.JSONException;
4140
import org.codehaus.jettison.json.JSONObject;
4241
import org.slf4j.Logger;

tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import org.apache.hadoop.fs.Path;
3939
import org.apache.hadoop.io.DataInputByteBuffer;
4040
import org.apache.hadoop.security.Credentials;
41+
import org.apache.hadoop.thirdparty.protobuf.ByteString;
42+
import org.apache.hadoop.thirdparty.protobuf.ByteString.Output;
4143
import org.apache.hadoop.yarn.api.records.LocalResource;
4244
import org.apache.hadoop.yarn.api.records.LocalResourceType;
4345
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
@@ -86,8 +88,6 @@
8688
import org.apache.tez.serviceplugins.api.ServicePluginsDescriptor;
8789

8890
import com.google.common.collect.Lists;
89-
import com.google.protobuf.ByteString;
90-
import com.google.protobuf.ByteString.Output;
9191

9292
@Private
9393
public final class DagTypeConverters {

0 commit comments

Comments
 (0)