rls, xds: fix parameter comments that do not match the formal parameter name (#7319)

This commit is contained in:
Chengyuan Zhang 2020-08-12 09:50:54 -07:00 committed by GitHub
parent 40b331e886
commit eb6110cefc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 77 deletions

View File

@ -356,7 +356,7 @@ public class CachingRlsLbClientTest {
/* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2), /* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2),
/* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300), /* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300),
/* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240), /* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240),
/* cacheSize= */ 1000, /* cacheSizeBytes= */ 1000,
/* validTargets= */ ImmutableList.of("a valid target"), /* validTargets= */ ImmutableList.of("a valid target"),
/* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com"); /* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com");
} }

View File

@ -195,7 +195,7 @@ public class RlsProtoConvertersTest {
/* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2), /* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2),
/* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300), /* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300),
/* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240), /* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240),
/* cacheSize= */ 1000, /* cacheSizeBytes= */ 1000,
/* validTargets= */ ImmutableList.of("a valid target"), /* validTargets= */ ImmutableList.of("a valid target"),
/* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com"); /* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com");

View File

@ -62,7 +62,7 @@ public class RlsRequestFactoryTest {
/* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2), /* lookupServiceTimeoutInMillis= */ TimeUnit.SECONDS.toMillis(2),
/* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300), /* maxAgeInMillis= */ TimeUnit.SECONDS.toMillis(300),
/* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240), /* staleAgeInMillis= */ TimeUnit.SECONDS.toMillis(240),
/* cacheSize= */ 1000, /* cacheSizeBytes= */ 1000,
/* validTargets= */ ImmutableList.of("a valid target"), /* validTargets= */ ImmutableList.of("a valid target"),
/* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com"); /* defaultTarget= */ "us_east_1.cloudbigtable.googleapis.com");

View File

@ -744,43 +744,42 @@ public class XdsClientImplTest {
verify(configWatcher).onConfigChanged(configUpdateCaptor.capture()); verify(configWatcher).onConfigChanged(configUpdateCaptor.capture());
List<EnvoyProtoData.Route> routes = configUpdateCaptor.getValue().getRoutes(); List<EnvoyProtoData.Route> routes = configUpdateCaptor.getValue().getRoutes();
assertThat(routes).hasSize(4); assertThat(routes).hasSize(4);
assertThat(routes.get(0)).isEqualTo( assertThat(routes.get(0))
new EnvoyProtoData.Route( .isEqualTo(
// path match with cluster route new EnvoyProtoData.Route(
new io.grpc.xds.RouteMatch( // path match with cluster route
/* prefix= */ null, new io.grpc.xds.RouteMatch(
/* path= */ "/service1/method1"), /* pathPrefixMatch= */ null,/* pathExactMatch= */ "/service1/method1"),
new EnvoyProtoData.RouteAction( new EnvoyProtoData.RouteAction(
TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null))); TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null)));
assertThat(routes.get(1)).isEqualTo( assertThat(routes.get(1))
new EnvoyProtoData.Route( .isEqualTo(
// path match with weighted cluster route new EnvoyProtoData.Route(
new io.grpc.xds.RouteMatch( // path match with weighted cluster route
/* prefix= */ null, new io.grpc.xds.RouteMatch(
/* path= */ "/service2/method2"), /* pathPrefixMatch= */ null,/* pathExactMatch= */ "/service2/method2"),
new EnvoyProtoData.RouteAction( new EnvoyProtoData.RouteAction(
TimeUnit.SECONDS.toNanos(15L), TimeUnit.SECONDS.toNanos(15L),
null, null,
ImmutableList.of( ImmutableList.of(
new EnvoyProtoData.ClusterWeight("cl21.googleapis.com", 30), new EnvoyProtoData.ClusterWeight("cl21.googleapis.com", 30),
new EnvoyProtoData.ClusterWeight("cl22.googleapis.com", 70) new EnvoyProtoData.ClusterWeight("cl22.googleapis.com", 70)))));
)))); assertThat(routes.get(2))
assertThat(routes.get(2)).isEqualTo( .isEqualTo(
new EnvoyProtoData.Route( new EnvoyProtoData.Route(
// prefix match with cluster route // prefix match with cluster route
new io.grpc.xds.RouteMatch( new io.grpc.xds.RouteMatch(
/* prefix= */ "/service1/", /* pathPrefixMatch= */ "/service1/",/* pathExactMatch= */ null),
/* path= */ null), new EnvoyProtoData.RouteAction(
new EnvoyProtoData.RouteAction( TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null)));
TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null))); assertThat(routes.get(3))
assertThat(routes.get(3)).isEqualTo( .isEqualTo(
new EnvoyProtoData.Route( new EnvoyProtoData.Route(
// default match with cluster route // default match with cluster route
new io.grpc.xds.RouteMatch( new io.grpc.xds.RouteMatch(
/* prefix= */ "", /* pathPrefixMatch= */ "",/* pathExactMatch= */ null),
/* path= */ null), new EnvoyProtoData.RouteAction(
new EnvoyProtoData.RouteAction( TimeUnit.SECONDS.toNanos(15L), "cluster.googleapis.com", null)));
TimeUnit.SECONDS.toNanos(15L), "cluster.googleapis.com", null)));
} }
/** /**

View File

@ -745,43 +745,42 @@ public class XdsClientImplTestV2 {
verify(configWatcher).onConfigChanged(configUpdateCaptor.capture()); verify(configWatcher).onConfigChanged(configUpdateCaptor.capture());
List<EnvoyProtoData.Route> routes = configUpdateCaptor.getValue().getRoutes(); List<EnvoyProtoData.Route> routes = configUpdateCaptor.getValue().getRoutes();
assertThat(routes).hasSize(4); assertThat(routes).hasSize(4);
assertThat(routes.get(0)).isEqualTo( assertThat(routes.get(0))
new EnvoyProtoData.Route( .isEqualTo(
// path match with cluster route new EnvoyProtoData.Route(
new io.grpc.xds.RouteMatch( // path match with cluster route
/* prefix= */ null, new io.grpc.xds.RouteMatch(
/* path= */ "/service1/method1"), /* pathPrefixMatch= */ null,/* pathExactMatch= */ "/service1/method1"),
new EnvoyProtoData.RouteAction( new EnvoyProtoData.RouteAction(
TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null))); TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null)));
assertThat(routes.get(1)).isEqualTo( assertThat(routes.get(1))
new EnvoyProtoData.Route( .isEqualTo(
// path match with weighted cluster route new EnvoyProtoData.Route(
new io.grpc.xds.RouteMatch( // path match with weighted cluster route
/* prefix= */ null, new io.grpc.xds.RouteMatch(
/* path= */ "/service2/method2"), /* pathPrefixMatch= */ null,/* pathExactMatch= */ "/service2/method2"),
new EnvoyProtoData.RouteAction( new EnvoyProtoData.RouteAction(
TimeUnit.SECONDS.toNanos(15L), TimeUnit.SECONDS.toNanos(15L),
null, null,
ImmutableList.of( ImmutableList.of(
new EnvoyProtoData.ClusterWeight("cl21.googleapis.com", 30), new EnvoyProtoData.ClusterWeight("cl21.googleapis.com", 30),
new EnvoyProtoData.ClusterWeight("cl22.googleapis.com", 70) new EnvoyProtoData.ClusterWeight("cl22.googleapis.com", 70)))));
)))); assertThat(routes.get(2))
assertThat(routes.get(2)).isEqualTo( .isEqualTo(
new EnvoyProtoData.Route( new EnvoyProtoData.Route(
// prefix match with cluster route // prefix match with cluster route
new io.grpc.xds.RouteMatch( new io.grpc.xds.RouteMatch(
/* prefix= */ "/service1/", /* pathPrefixMatch= */ "/service1/",/* pathExactMatch= */ null),
/* path= */ null), new EnvoyProtoData.RouteAction(
new EnvoyProtoData.RouteAction( TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null)));
TimeUnit.SECONDS.toNanos(15L), "cl1.googleapis.com", null))); assertThat(routes.get(3))
assertThat(routes.get(3)).isEqualTo( .isEqualTo(
new EnvoyProtoData.Route( new EnvoyProtoData.Route(
// default match with cluster route // default match with cluster route
new io.grpc.xds.RouteMatch( new io.grpc.xds.RouteMatch(
/* prefix= */ "", /* pathPrefixMatch= */ "",/* pathExactMatch= */ null),
/* path= */ null), new EnvoyProtoData.RouteAction(
new EnvoyProtoData.RouteAction( TimeUnit.SECONDS.toNanos(15L), "cluster.googleapis.com", null)));
TimeUnit.SECONDS.toNanos(15L), "cluster.googleapis.com", null)));
} }
/** /**