Skip to content

Commit d3ecee1

Browse files
committed
Shade Netty into r2, and shade ZooKeeper along with its transitive Netty dependency.
1 parent bec0e63 commit d3ecee1

File tree

146 files changed

+771
-673
lines changed

Some content is hidden

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

146 files changed

+771
-673
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ and what APIs have changed, if applicable.
1414

1515
## [Unreleased]
1616

17+
## [29.38.0] - 2022-08-25
18+
- Introduce restli-netty, a shaded Netty dependency for use with r2.
19+
1720
## [29.37.15] - 2022-08-23
1821
- Exclude transitive Netty dependency for ZooKeeper client.
1922

@@ -5309,7 +5312,8 @@ patch operations can re-use these classes for generating patch messages.
53095312

53105313
## [0.14.1]
53115314

5312-
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.37.15...master
5315+
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.38.0...master
5316+
[29.38.0]: https://github.com/linkedin/rest.li/compare/v29.37.15...v29.38.0
53135317
[29.37.15]: https://github.com/linkedin/rest.li/compare/v29.37.14...v29.37.15
53145318
[29.37.14]: https://github.com/linkedin/rest.li/compare/v29.37.13...v29.37.14
53155319
[29.37.13]: https://github.com/linkedin/rest.li/compare/v29.37.12...v29.37.13

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616

1717
buildscript {
1818
repositories {
19+
gradlePluginPortal()
1920
jcenter()
2021
}
2122
dependencies {
23+
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
2224
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0'
2325
classpath 'org.jacoco:org.jacoco.core:0.8.7'
2426
}

build_script/publications.gradle

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,21 @@ def manipulatePomXml = {
6161
publishing {
6262
publications {
6363
// Define the "release" publication
64-
release(MavenPublication) {
65-
from components.java
64+
release(MavenPublication) { publication ->
65+
if (project.name == 'restli-netty' || project.name == 'restli-zookeeper') {
66+
apply plugin: 'com.github.johnrengelman.shadow'
67+
project.shadow.component(publication)
68+
} else {
69+
from components.java
70+
}
6671

6772
afterEvaluate {
6873
// Add all extra archives (sources, javadoc, any custom archives e.g. all)
6974
project.configurations.archives.allArtifacts.forEach {
70-
if (it.classifier) {
75+
// Skip 'slim' identifier, otherwise this logic attemps to publish the disabled slim jar for restli-netty.
76+
// This requirement is related to the workaround for IDEA-163411 in the restli-netty project. When that bug
77+
// is resolved this can be simplified.
78+
if (it.classifier && it.classifier != 'slim') {
7179
artifact it
7280
}
7381
}

d2-int-test/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ dependencies {
66
compile project(':data')
77
compile project(':pegasus-common')
88
compile project(':li-jersey-uri')
9+
implementation project(path: ':restli-zookeeper', configuration: 'shadow')
910
compile fileTree(dir: 'lib', include: '*.jar')
1011
compile externalDependency.commonsCodec
1112
compile externalDependency.commonsIo
1213
compile externalDependency.commonsHttpClient
13-
compile(externalDependency.zookeeper) {
14-
exclude group: 'io.netty'
15-
}
1614
compile externalDependency.jdkTools
17-
compile externalDependency.netty
1815
testCompile externalDependency.testng
1916
testCompile externalDependency.commonsIo
2017
testCompile externalDependency.metricsCore

d2-int-test/src/test/java/com/linkedin/d2/quorum/ZKPeer.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
import org.slf4j.Logger;
3232
import org.slf4j.LoggerFactory;
3333
import org.apache.commons.io.FileUtils;
34-
import org.apache.zookeeper.server.NIOServerCnxnFactory;
35-
import org.apache.zookeeper.server.ZKDatabase;
36-
import org.apache.zookeeper.server.ZooKeeperServer;
37-
import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
38-
import org.apache.zookeeper.server.quorum.Election;
39-
import org.apache.zookeeper.server.quorum.QuorumPeer;
40-
import org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
41-
import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
42-
import org.apache.zookeeper.server.quorum.flexible.QuorumMaj;
34+
import com.linkedin.pegasus.org.apache.zookeeper.server.NIOServerCnxnFactory;
35+
import com.linkedin.pegasus.org.apache.zookeeper.server.ZKDatabase;
36+
import com.linkedin.pegasus.org.apache.zookeeper.server.ZooKeeperServer;
37+
import com.linkedin.pegasus.org.apache.zookeeper.server.persistence.FileTxnSnapLog;
38+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.Election;
39+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer;
40+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
41+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
42+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.flexible.QuorumMaj;
4343

4444
import static org.testng.Assert.assertTrue;
4545
import static org.testng.Assert.fail;

d2-int-test/src/test/java/com/linkedin/d2/quorum/ZKQuorum.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import java.util.Iterator;
2323
import java.util.Map;
2424

25-
import org.apache.zookeeper.server.quorum.QuorumPeer;
26-
import org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
27-
import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
28-
import org.apache.zookeeper.server.ZooKeeperServer;
25+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer;
26+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
27+
import com.linkedin.pegasus.org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
28+
import com.linkedin.pegasus.org.apache.zookeeper.server.ZooKeeperServer;
2929
import org.slf4j.Logger;
3030
import org.slf4j.LoggerFactory;
3131

d2-test-api/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
dependencies {
22
compile project(':d2')
3+
implementation project(path: ':restli-zookeeper', configuration: 'shadow')
34
compile externalDependency.testng
45
compile externalDependency.metricsCore
56
compile externalDependency.xerialSnappy

d2-test-api/src/main/java/com/linkedin/d2/discovery/stores/zk/ZKServer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import java.net.InetSocketAddress;
2222
import java.util.concurrent.CountDownLatch;
2323
import org.apache.commons.io.FileUtils;
24-
import org.apache.zookeeper.server.NIOServerCnxn;
25-
import org.apache.zookeeper.server.NIOServerCnxnFactory;
26-
import org.apache.zookeeper.server.ZooKeeperServer;
24+
import com.linkedin.pegasus.org.apache.zookeeper.server.NIOServerCnxn;
25+
import com.linkedin.pegasus.org.apache.zookeeper.server.NIOServerCnxnFactory;
26+
import com.linkedin.pegasus.org.apache.zookeeper.server.ZooKeeperServer;
2727

2828
/**
2929
* Very simple wrapper around ZooKeeper server, intended only for TEST use.

d2-test-api/src/main/java/com/linkedin/d2/discovery/stores/zk/ZKTestUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package com.linkedin.d2.discovery.stores.zk;
1818

19-
import org.apache.zookeeper.WatchedEvent;
20-
import org.apache.zookeeper.Watcher;
19+
import com.linkedin.pegasus.org.apache.zookeeper.WatchedEvent;
20+
import com.linkedin.pegasus.org.apache.zookeeper.Watcher;
2121
import org.testng.Assert;
2222

2323
import java.io.File;

d2/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ dependencies {
66
compile project(':data')
77
compile project(':pegasus-common')
88
compile project(':li-jersey-uri')
9+
implementation project(path: ':restli-zookeeper', configuration: 'shadow')
910
compile externalDependency.commonsCodec
1011
compile externalDependency.commonsIo
1112
compile externalDependency.commonsCli
1213
compile externalDependency.commonsHttpClient
1314
compile externalDependency.httpclient
1415
compile externalDependency.httpcore
1516
compile externalDependency.hdrhistogram
16-
compile(externalDependency.zookeeper) {
17-
exclude group: 'io.netty'
18-
}
1917
compile externalDependency.jacksonCore
2018
compile externalDependency.jacksonDataBind
2119
compile externalDependency.jdkTools

0 commit comments

Comments
 (0)