Skip to content

Commit 4674a0b

Browse files
committed
Fix repository-hdfs gradle to perform transformation directly
1 parent f715051 commit 4674a0b

File tree

5 files changed

+25
-251
lines changed

5 files changed

+25
-251
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dependencies/patches/hdfs/HdfsClassPatcher.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ record JarPatchers(String artifactName, Map<String, Function<ClassWriter, ClassV
5454
)
5555
),
5656
new JarPatchers(
57-
"hadoop-auth",
58-
Map.of("org/apache/hadoop/security/authentication/client/KerberosAuthenticator.class", SubjectGetSubjectPatcher::new)
57+
"hadoop-client-api",
58+
Map.ofEntries(
59+
entry("org/apache/hadoop/util/ShutdownHookManager.class", ShutdownHookManagerPatcher::new),
60+
entry("org/apache/hadoop/util/Shell.class", ShellPatcher::new),
61+
entry("org/apache/hadoop/security/UserGroupInformation.class", SubjectGetSubjectPatcher::new),
62+
entry("org/apache/hadoop/security/authentication/client/KerberosAuthenticator.class", SubjectGetSubjectPatcher::new)
63+
)
5964
)
6065
);
6166

plugins/repository-hdfs/build.gradle

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@ def patched = Attribute.of('patched', Boolean)
2727
configurations {
2828
hdfsFixture2
2929
hdfsFixture3
30-
hdfsClientApi {
30+
compileClasspath {
31+
attributes {
32+
attribute(patched, true)
33+
}
34+
}
35+
runtimeClasspath {
3136
attributes {
3237
attribute(patched, true)
3338
}
3439
}
3540
}
3641

3742
dependencies {
38-
hdfsClientApi "org.apache.hadoop:hadoop-client-api:${versions.hadoop}"
39-
api project(path: 'hadoop-client-api', configuration: 'default')
40-
if (isEclipse) {
41-
/*
42-
* Eclipse can't pick up the shadow dependency so we point it at *something*
43-
* so it can compile things.
44-
*/
45-
api project(path: 'hadoop-client-api')
46-
}
43+
api("org.apache.hadoop:hadoop-client-api:${versions.hadoop}")
4744
runtimeOnly "org.apache.hadoop:hadoop-client-runtime:${versions.hadoop}"
4845
implementation "org.apache.hadoop:hadoop-hdfs:${versions.hadoop}"
4946
api "com.google.protobuf:protobuf-java:${versions.protobuf}"
@@ -88,7 +85,7 @@ dependencies {
8885
from.attribute(patched, false)
8986
to.attribute(patched, true)
9087
parameters {
91-
matchingArtifacts = ["hadoop-common", "hadoop-auth"]
88+
matchingArtifacts = ["hadoop-client-api"]
9289
}
9390
}
9491
}
@@ -212,6 +209,15 @@ tasks.named("thirdPartyAudit").configure {
212209
'org.apache.hadoop.thirdparty.protobuf.UnsafeUtil$MemoryAccessor',
213210
'org.apache.hadoop.thirdparty.protobuf.MessageSchema',
214211
'org.apache.hadoop.thirdparty.protobuf.UnsafeUtil$Android32MemoryAccessor',
215-
'org.apache.hadoop.thirdparty.protobuf.UnsafeUtil$Android64MemoryAccessor'
212+
'org.apache.hadoop.thirdparty.protobuf.UnsafeUtil$Android64MemoryAccessor',
213+
'org.apache.hadoop.thirdparty.protobuf.UnsafeUtil$Android64MemoryAccessor',
214+
'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm',
215+
'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm$Slot',
216+
'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer',
217+
'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer$1',
218+
'org.apache.hadoop.io.nativeio.NativeIO',
219+
'org.apache.hadoop.service.launcher.InterruptEscalator',
220+
'org.apache.hadoop.service.launcher.IrqHandler',
221+
'org.apache.hadoop.util.SignalLogger$Handler'
216222
)
217223
}

plugins/repository-hdfs/hadoop-client-api/build.gradle

Lines changed: 0 additions & 33 deletions
This file was deleted.

plugins/repository-hdfs/hadoop-client-api/licenses/hadoop-client-api-LICENSE.txt

Lines changed: 0 additions & 202 deletions
This file was deleted.

plugins/repository-hdfs/hadoop-client-api/licenses/hadoop-client-api-NOTICE.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)