• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 The gRPC Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package io.grpc.internal;
18 
19 import io.grpc.Attributes;
20 import java.util.Map;
21 
22 /**
23  * Special attributes that are only useful to gRPC.
24  */
25 public final class GrpcAttributes {
26   /**
27    * Attribute key for service config.
28    */
29   public static final Attributes.Key<Map<String, Object>> NAME_RESOLVER_SERVICE_CONFIG =
30       Attributes.Key.create("service-config");
31 
32   /**
33    * The naming authority of a gRPC LB server address.  It is an address-group-level attribute,
34    * present when the address group is a LoadBalancer.
35    */
36   public static final Attributes.Key<String> ATTR_LB_ADDR_AUTHORITY =
37       Attributes.Key.create("io.grpc.grpclb.lbAddrAuthority");
38 
39   /**
40    * Whether this EquivalentAddressGroup was provided by a GRPCLB server. It would be rare for this
41    * value to be {@code false}; generally it would be better to not have the key present at all.
42    */
43   public static final Attributes.Key<Boolean> ATTR_LB_PROVIDED_BACKEND =
44       Attributes.Key.create("io.grpc.grpclb.lbProvidedBackend");
45 
GrpcAttributes()46   private GrpcAttributes() {}
47 }
48