Skip to content

Commit 0137b04

Browse files
committed
replace org.apache.avro in generated source code
use temp version of hadoop-shaded-avro Update JobQueueChangeEvent.java more avro related code that needs changes more exclusions use thirdparty avro staging jar use thirdparty release
1 parent 22d5d20 commit 0137b04

14 files changed

Lines changed: 76 additions & 38 deletions

File tree

hadoop-client-modules/hadoop-client-minicluster/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
<groupId>org.apache.avro</groupId>
137137
<artifactId>avro</artifactId>
138138
</exclusion>
139+
<exclusion>
140+
<groupId>org.apache.hadoop.thirdparty</groupId>
141+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
142+
</exclusion>
139143
<exclusion>
140144
<groupId>org.apache.curator</groupId>
141145
<artifactId>curator-client</artifactId>

hadoop-client-modules/hadoop-client/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
<groupId>org.apache.avro</groupId>
115115
<artifactId>avro</artifactId>
116116
</exclusion>
117+
<exclusion>
118+
<groupId>org.apache.hadoop.thirdparty</groupId>
119+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
120+
</exclusion>
117121
<exclusion>
118122
<groupId>org.eclipse.jetty</groupId>
119123
<artifactId>jetty-server</artifactId>
@@ -166,6 +170,10 @@
166170
<groupId>org.apache.avro</groupId>
167171
<artifactId>avro</artifactId>
168172
</exclusion>
173+
<exclusion>
174+
<groupId>org.apache.hadoop.thirdparty</groupId>
175+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
176+
</exclusion>
169177
<exclusion>
170178
<groupId>com.sun.jersey</groupId>
171179
<artifactId>jersey-core</artifactId>
@@ -278,6 +286,10 @@
278286
<groupId>org.apache.avro</groupId>
279287
<artifactId>avro</artifactId>
280288
</exclusion>
289+
<exclusion>
290+
<groupId>org.apache.hadoop.thirdparty</groupId>
291+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
292+
</exclusion>
281293
<exclusion>
282294
<groupId>org.apache.hadoop</groupId>
283295
<artifactId>hadoop-annotations</artifactId>
@@ -319,6 +331,10 @@
319331
<groupId>org.apache.avro</groupId>
320332
<artifactId>avro</artifactId>
321333
</exclusion>
334+
<exclusion>
335+
<groupId>org.apache.hadoop.thirdparty</groupId>
336+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
337+
</exclusion>
322338
<exclusion>
323339
<groupId>org.apache.hadoop</groupId>
324340
<artifactId>hadoop-annotations</artifactId>

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
</dependency>
251251
<dependency>
252252
<groupId>org.apache.hadoop.thirdparty</groupId>
253-
<artifactId>hadoop-shaded-avro</artifactId>
253+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
254254
<scope>compile</scope>
255255
</dependency>
256256
<dependency>
@@ -617,6 +617,8 @@
617617
<copy toDir="${project.build.directory}/test-classes">
618618
<fileset dir="${basedir}/src/main/conf"/>
619619
</copy>
620+
621+
<replace dir="${project.build.directory}/generated-test-sources/java" token="org.apache.avro" value="org.apache.hadoop.thirdparty.avro"/>
620622
</target>
621623
</configuration>
622624
</execution>

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/serializer/avro/TestAvroSerialization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class TestAvroSerialization {
3333
@Test
3434
public void testSpecific() throws Exception {
3535
AvroRecord before = new AvroRecord();
36-
before.intField = 5;
36+
before.setIntField(5);
3737
AvroRecord after = SerializationTestUtil.testSerialization(conf, before);
3838
assertEquals(before, after);
3939
}

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@
131131
<artifactId>maven-antrun-plugin</artifactId>
132132
<executions>
133133
<execution>
134+
<id>generate-sources-ant-replace</id>
135+
<phase>generate-sources</phase>
136+
<goals>
137+
<goal>run</goal>
138+
</goals>
139+
<configuration>
140+
<tasks>
141+
<replace dir="${project.build.directory}/generated-sources/avro" token="org.apache.avro" value="org.apache.hadoop.thirdparty.avro"/>
142+
</tasks>
143+
</configuration>
144+
</execution>
145+
<execution>
146+
<id>pre-site-ant-copy</id>
134147
<phase>pre-site</phase>
135148
<goals>
136149
<goal>run</goal>

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobQueueChangeEvent.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
import java.util.Set;
2222

23-
import org.apache.hadoop.thirdparty.avro.util.Utf8;
2423
import org.apache.hadoop.mapreduce.JobID;
24+
import org.apache.hadoop.thirdparty.avro.util.Utf8;
2525
import org.apache.hadoop.util.StringUtils;
2626
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent;
2727
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric;
@@ -31,8 +31,8 @@ public class JobQueueChangeEvent implements HistoryEvent {
3131
private JobQueueChange datum = new JobQueueChange();
3232

3333
public JobQueueChangeEvent(JobID id, String queueName) {
34-
datum.jobid = new Utf8(id.toString());
35-
datum.jobQueueName = new Utf8(queueName);
34+
datum.setJobid(new Utf8(id.toString()));
35+
datum.setJobQueueName(new Utf8(queueName));
3636
}
3737

3838
JobQueueChangeEvent() { }
@@ -54,13 +54,13 @@ public void setDatum(Object datum) {
5454

5555
/** Get the Job ID */
5656
public JobID getJobId() {
57-
return JobID.forName(datum.jobid.toString());
57+
return JobID.forName(datum.getJobid().toString());
5858
}
5959

6060
/** Get the new Job queue name */
6161
public String getJobQueueName() {
62-
if (datum.jobQueueName != null) {
63-
return datum.jobQueueName.toString();
62+
if (datum.getJobQueueName() != null) {
63+
return datum.getJobQueueName().toString();
6464
}
6565
return null;
6666
}

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</dependency>
4343
<dependency>
4444
<groupId>org.apache.hadoop.thirdparty</groupId>
45-
<artifactId>hadoop-shaded-avro</artifactId>
45+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
4646
<exclusions>
4747
<exclusion>
4848
<groupId>org.slf4j</groupId>

hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</dependency>
4444
<dependency>
4545
<groupId>org.apache.hadoop.thirdparty</groupId>
46-
<artifactId>hadoop-shaded-avro</artifactId>
46+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
4747
<exclusions>
4848
<exclusion>
4949
<groupId>org.slf4j</groupId>

hadoop-mapreduce-project/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
</dependency>
5858
<dependency>
5959
<groupId>org.apache.hadoop.thirdparty</groupId>
60-
<artifactId>hadoop-shaded-avro_1_11</artifactId>
60+
<artifactId>hadoop-shaded-avro_1.11</artifactId>
61+
<version>${hadoop-thirdparty.avro.version}</version>
6162
<exclusions>
6263
<exclusion>
6364
<groupId>org.slf4j</groupId>

hadoop-project/pom.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
<hadoop.common.build.dir>${basedir}/../../hadoop-common-project/hadoop-common/target</hadoop.common.build.dir>
6363
<java.security.egd>file:///dev/urandom</java.security.egd>
6464

65-
<!-- avro version -->
66-
<hadoop-shaded-avro.version>1.2.0-SNAPSHOT</hadoop-shaded-avro.version>
65+
<!-- avro version: avro.version needs to match avro version used in hadoop-shaded-avro -->
66+
<avro.version>1.11.3</avro.version>
6767

6868
<!-- jersey version -->
6969
<jersey.version>1.19.4</jersey.version>
@@ -96,7 +96,9 @@
9696
<hadoop.protobuf.version>3.21.12</hadoop.protobuf.version>
9797
<protoc.path>${env.HADOOP_PROTOC_PATH}</protoc.path>
9898

99+
99100
<hadoop-thirdparty.version>1.2.0</hadoop-thirdparty.version>
101+
<hadoop-thirdparty.avro.version>${hadoop-thirdparty.version}</hadoop-thirdparty.avro.version>
100102
<hadoop-thirdparty-protobuf.version>${hadoop-thirdparty.version}</hadoop-thirdparty-protobuf.version>
101103
<hadoop-thirdparty-guava.version>${hadoop-thirdparty.version}</hadoop-thirdparty-guava.version>
102104
<hadoop-thirdparty-shaded-prefix>org.apache.hadoop.thirdparty</hadoop-thirdparty-shaded-prefix>
@@ -1325,8 +1327,8 @@
13251327
</dependency>
13261328
<dependency>
13271329
<groupId>org.apache.hadoop.thirdparty</groupId>
1328-
<artifactId>hadoop-shaded-avro</artifactId>
1329-
<version>${hadoop-shaded-avro.version}</version>
1330+
<artifactId>hadoop-shaded-avro_1_11</artifactId>
1331+
<version>${hadoop-thirdparty.avro.version}</version>
13301332
</dependency>
13311333
<dependency>
13321334
<groupId>net.sf.kosmosfs</groupId>
@@ -2086,9 +2088,9 @@
20862088
<version>${maven-source-plugin.version}</version>
20872089
</plugin>
20882090
<plugin>
2089-
<groupId>org.apache.hadoop.thirdparty</groupId>
2090-
<artifactId>hadoop-shaded-avro-maven-plugin</artifactId>
2091-
<version>${hadoop-shaded-avro.version.version}</version>
2091+
<groupId>org.apache.avroy</groupId>
2092+
<artifactId>avro-maven-plugin</artifactId>
2093+
<version>${avro.version}</version>
20922094
</plugin>
20932095
<plugin>
20942096
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)