Skip to content

Commit

Permalink
Change Round Robin and WeightedRoundRobin into petiole policies (grpc…
Browse files Browse the repository at this point in the history
…#10528)

* Change Round Robin and WeightedRoundRobin into petiole policies
  • Loading branch information
larry-safran authored and DNVindhya committed Oct 5, 2023
1 parent c51508c commit 0a2ebb4
Show file tree
Hide file tree
Showing 15 changed files with 983 additions and 629 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
/** Unit tests for {@link ManagedChannelImpl}. */
@RunWith(JUnit4.class)
// TODO(creamsoup) remove backward compatible check when fully migrated
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "DataFlowIssue"})
public class ManagedChannelImplTest {
private static final int DEFAULT_PORT = 447;

Expand Down
5 changes: 5 additions & 0 deletions core/src/testFixtures/java/io/grpc/internal/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.grpc.CallOptions;
import io.grpc.ChannelLogger;
import io.grpc.ClientStreamTracer;
import io.grpc.EquivalentAddressGroup;
import io.grpc.InternalLogId;
import io.grpc.LoadBalancer.PickResult;
import io.grpc.LoadBalancer.PickSubchannelArgs;
Expand Down Expand Up @@ -143,6 +144,10 @@ public Runnable answer(InvocationOnMock invocation) throws Throwable {
return captor;
}

public static EquivalentAddressGroup stripAttrs(EquivalentAddressGroup eag) {
return new EquivalentAddressGroup(eag.getAddresses());
}

private TestUtils() {
}

Expand Down
1 change: 1 addition & 0 deletions examples/android/strictmode/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'

// You need to build grpc-java to obtain these libraries below.
implementation 'io.grpc:grpc-core:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-okhttp:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-protobuf-lite:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
implementation 'io.grpc:grpc-stub:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
Expand Down
1 change: 1 addition & 0 deletions examples/android/strictmode/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
-dontwarn javax.naming.**
-dontwarn okio.**
-dontwarn sun.misc.Unsafe

12 changes: 10 additions & 2 deletions util/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "java-library"
id "java-test-fixtures"
id "maven-publish"

id "me.champeau.jmh"
Expand All @@ -19,11 +20,18 @@ dependencies {

implementation libraries.animalsniffer.annotations,
libraries.guava
testImplementation testFixtures(project(':grpc-api')),
testImplementation libraries.guava.testlib,
testFixtures(project(':grpc-api')),
testFixtures(project(':grpc-core')),
project(':grpc-testing')
testImplementation libraries.guava.testlib

testFixturesApi project(':grpc-core')
testFixturesImplementation libraries.guava,
libraries.junit,
libraries.mockito.core,
testFixtures(project(':grpc-api')),
testFixtures(project(':grpc-core')),
project(':grpc-testing')
jmh project(':grpc-testing')

signature libraries.signature.java
Expand Down
Loading

0 comments on commit 0a2ebb4

Please sign in to comment.