aboutsummaryrefslogtreecommitdiff
path: root/grpclb
diff options
context:
space:
mode:
authorzpencer <spencerfang@google.com>2018-05-14 11:30:06 -0700
committerGitHub <noreply@github.com>2018-05-14 11:30:06 -0700
commit21b73bbdc1e7f871573eaedc741ffca3a63a3ac5 (patch)
treeae58718d9b9f8b6a214be5fd558a2b524c95660a /grpclb
parent277c33c37f260a91663c38d83f53b02504e0ac53 (diff)
downloadgrpc-grpc-java-21b73bbdc1e7f871573eaedc741ffca3a63a3ac5.tar.gz
core: partially stabilize Attributes API (#4458)
Deprecate static builder method, Keys.of(), add a notice of plans to remove keys(), emphasize that the name is only a debug label. The `@ExperimentalAPI` is left on the class because there are still issues around hashCode/equals.
Diffstat (limited to 'grpclb')
-rw-r--r--grpclb/src/main/java/io/grpc/grpclb/GrpclbConstants.java2
-rw-r--r--grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java2
-rw-r--r--grpclb/src/test/java/io/grpc/grpclb/CachedSubchannelPoolTest.java2
-rw-r--r--grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/grpclb/src/main/java/io/grpc/grpclb/GrpclbConstants.java b/grpclb/src/main/java/io/grpc/grpclb/GrpclbConstants.java
index 147e09d78..ebc2e3d7a 100644
--- a/grpclb/src/main/java/io/grpc/grpclb/GrpclbConstants.java
+++ b/grpclb/src/main/java/io/grpc/grpclb/GrpclbConstants.java
@@ -38,7 +38,7 @@ public final class GrpclbConstants {
* An attribute of a name resolution result, designating the LB policy.
*/
public static final Attributes.Key<LbPolicy> ATTR_LB_POLICY =
- Attributes.Key.of("io.grpc.grpclb.lbPolicy");
+ Attributes.Key.create("io.grpc.grpclb.lbPolicy");
/**
* The opaque token given by the remote balancer for each returned server address. The client
diff --git a/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java b/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java
index e2e175e5b..f09b01f48 100644
--- a/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java
+++ b/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java
@@ -100,7 +100,7 @@ final class GrpclbState {
private final ScheduledExecutorService timerService;
private static final Attributes.Key<AtomicReference<ConnectivityStateInfo>> STATE_INFO =
- Attributes.Key.of("io.grpc.grpclb.GrpclbLoadBalancer.stateInfo");
+ Attributes.Key.create("io.grpc.grpclb.GrpclbLoadBalancer.stateInfo");
// Scheduled only once. Never reset.
@Nullable
diff --git a/grpclb/src/test/java/io/grpc/grpclb/CachedSubchannelPoolTest.java b/grpclb/src/test/java/io/grpc/grpclb/CachedSubchannelPoolTest.java
index 2b52b0995..62f8c6c97 100644
--- a/grpclb/src/test/java/io/grpc/grpclb/CachedSubchannelPoolTest.java
+++ b/grpclb/src/test/java/io/grpc/grpclb/CachedSubchannelPoolTest.java
@@ -54,7 +54,7 @@ public class CachedSubchannelPoolTest {
new EquivalentAddressGroup(new FakeSocketAddress("fake-address-1"), Attributes.EMPTY);
private static final EquivalentAddressGroup EAG2 =
new EquivalentAddressGroup(new FakeSocketAddress("fake-address-2"), Attributes.EMPTY);
- private static final Attributes.Key<String> ATTR_KEY = Attributes.Key.of("test-attr");
+ private static final Attributes.Key<String> ATTR_KEY = Attributes.Key.create("test-attr");
private static final Attributes ATTRS1 = Attributes.newBuilder().set(ATTR_KEY, "1").build();
private static final Attributes ATTRS2 = Attributes.newBuilder().set(ATTR_KEY, "2").build();
private static final FakeClock.TaskFilter SHUTDOWN_SCHEDULED_TASK_FILTER =
diff --git a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java
index 69c934537..04ba5d0ec 100644
--- a/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java
+++ b/grpclb/src/test/java/io/grpc/grpclb/GrpclbLoadBalancerTest.java
@@ -102,7 +102,7 @@ import org.mockito.stubbing.Answer;
@RunWith(JUnit4.class)
public class GrpclbLoadBalancerTest {
private static final Attributes.Key<String> RESOLUTION_ATTR =
- Attributes.Key.of("resolution-attr");
+ Attributes.Key.create("resolution-attr");
private static final String SERVICE_AUTHORITY = "api.google.com";
private static final FakeClock.TaskFilter LOAD_REPORTING_TASK_FILTER =
new FakeClock.TaskFilter() {