diff --git a/grpclb/src/generated/main/java/io/grpc/grpclb/LoadBalancerProto.java b/grpclb/src/generated/main/java/io/grpc/grpclb/LoadBalancerProto.java index 893da18a68..25be279c05 100644 --- a/grpclb/src/generated/main/java/io/grpc/grpclb/LoadBalancerProto.java +++ b/grpclb/src/generated/main/java/io/grpc/grpclb/LoadBalancerProto.java @@ -87,15 +87,14 @@ public final class LoadBalancerProto { "pe\"}\n\032InitialLoadBalanceResponse\022\036\n\026load" + "_balancer_delegate\030\001 \001(\t\022?\n\034client_stats" + "_report_interval\030\002 \001(\0132\031.google.protobuf" + - ".Duration\"i\n\nServerList\022#\n\007servers\030\001 \003(\013" + - "2\022.grpc.lb.v1.Server\0226\n\023expiration_inter" + - "val\030\003 \001(\0132\031.google.protobuf.Duration\"Z\n\006" + - "Server\022\022\n\nip_address\030\001 \001(\014\022\014\n\004port\030\002 \001(\005" + - "\022\032\n\022load_balance_token\030\003 \001(\t\022\014\n\004drop\030\004 \001" + - "(\010J\004\010\005\020\0062b\n\014LoadBalancer\022R\n\013BalanceLoad\022", - "\036.grpc.lb.v1.LoadBalanceRequest\032\037.grpc.l" + - "b.v1.LoadBalanceResponse(\0010\001B%\n\016io.grpc." + - "grpclbB\021LoadBalancerProtoP\001b\006proto3" + ".Duration\"7\n\nServerList\022#\n\007servers\030\001 \003(\013" + + "2\022.grpc.lb.v1.ServerJ\004\010\003\020\004\"Z\n\006Server\022\022\n\n" + + "ip_address\030\001 \001(\014\022\014\n\004port\030\002 \001(\005\022\032\n\022load_b" + + "alance_token\030\003 \001(\t\022\014\n\004drop\030\004 \001(\010J\004\010\005\020\0062b" + + "\n\014LoadBalancer\022R\n\013BalanceLoad\022\036.grpc.lb." + + "v1.LoadBalanceRequest\032\037.grpc.lb.v1.LoadB", + "alanceResponse(\0010\001B%\n\016io.grpc.grpclbB\021Lo" + + "adBalancerProtoP\001b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -152,7 +151,7 @@ public final class LoadBalancerProto { internal_static_grpc_lb_v1_ServerList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_grpc_lb_v1_ServerList_descriptor, - new java.lang.String[] { "Servers", "ExpirationInterval", }); + new java.lang.String[] { "Servers", }); internal_static_grpc_lb_v1_Server_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_grpc_lb_v1_Server_fieldAccessorTable = new diff --git a/grpclb/src/generated/main/java/io/grpc/grpclb/ServerList.java b/grpclb/src/generated/main/java/io/grpc/grpclb/ServerList.java index 3b7c3e2f4a..5c5fc45e49 100644 --- a/grpclb/src/generated/main/java/io/grpc/grpclb/ServerList.java +++ b/grpclb/src/generated/main/java/io/grpc/grpclb/ServerList.java @@ -52,19 +52,6 @@ public final class ServerList extends input.readMessage(io.grpc.grpclb.Server.parser(), extensionRegistry)); break; } - case 26: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (expirationInterval_ != null) { - subBuilder = expirationInterval_.toBuilder(); - } - expirationInterval_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expirationInterval_); - expirationInterval_ = subBuilder.buildPartial(); - } - - break; - } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -91,7 +78,6 @@ public final class ServerList extends io.grpc.grpclb.ServerList.class, io.grpc.grpclb.ServerList.Builder.class); } - private int bitField0_; public static final int SERVERS_FIELD_NUMBER = 1; private java.util.List servers_; /** @@ -162,48 +148,6 @@ public final class ServerList extends return servers_.get(index); } - public static final int EXPIRATION_INTERVAL_FIELD_NUMBER = 3; - private com.google.protobuf.Duration expirationInterval_; - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public boolean hasExpirationInterval() { - return expirationInterval_ != null; - } - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public com.google.protobuf.Duration getExpirationInterval() { - return expirationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; - } - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public com.google.protobuf.DurationOrBuilder getExpirationIntervalOrBuilder() { - return getExpirationInterval(); - } - private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; @@ -219,9 +163,6 @@ public final class ServerList extends for (int i = 0; i < servers_.size(); i++) { output.writeMessage(1, servers_.get(i)); } - if (expirationInterval_ != null) { - output.writeMessage(3, getExpirationInterval()); - } } public int getSerializedSize() { @@ -233,10 +174,6 @@ public final class ServerList extends size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, servers_.get(i)); } - if (expirationInterval_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getExpirationInterval()); - } memoizedSize = size; return size; } @@ -255,11 +192,6 @@ public final class ServerList extends boolean result = true; result = result && getServersList() .equals(other.getServersList()); - result = result && (hasExpirationInterval() == other.hasExpirationInterval()); - if (hasExpirationInterval()) { - result = result && getExpirationInterval() - .equals(other.getExpirationInterval()); - } return result; } @@ -274,10 +206,6 @@ public final class ServerList extends hash = (37 * hash) + SERVERS_FIELD_NUMBER; hash = (53 * hash) + getServersList().hashCode(); } - if (hasExpirationInterval()) { - hash = (37 * hash) + EXPIRATION_INTERVAL_FIELD_NUMBER; - hash = (53 * hash) + getExpirationInterval().hashCode(); - } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -414,12 +342,6 @@ public final class ServerList extends } else { serversBuilder_.clear(); } - if (expirationIntervalBuilder_ == null) { - expirationInterval_ = null; - } else { - expirationInterval_ = null; - expirationIntervalBuilder_ = null; - } return this; } @@ -443,7 +365,6 @@ public final class ServerList extends public io.grpc.grpclb.ServerList buildPartial() { io.grpc.grpclb.ServerList result = new io.grpc.grpclb.ServerList(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (serversBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { servers_ = java.util.Collections.unmodifiableList(servers_); @@ -453,12 +374,6 @@ public final class ServerList extends } else { result.servers_ = serversBuilder_.build(); } - if (expirationIntervalBuilder_ == null) { - result.expirationInterval_ = expirationInterval_; - } else { - result.expirationInterval_ = expirationIntervalBuilder_.build(); - } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -526,9 +441,6 @@ public final class ServerList extends } } } - if (other.hasExpirationInterval()) { - mergeExpirationInterval(other.getExpirationInterval()); - } onChanged(); return this; } @@ -921,186 +833,6 @@ public final class ServerList extends } return serversBuilder_; } - - private com.google.protobuf.Duration expirationInterval_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> expirationIntervalBuilder_; - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public boolean hasExpirationInterval() { - return expirationIntervalBuilder_ != null || expirationInterval_ != null; - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public com.google.protobuf.Duration getExpirationInterval() { - if (expirationIntervalBuilder_ == null) { - return expirationInterval_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; - } else { - return expirationIntervalBuilder_.getMessage(); - } - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public Builder setExpirationInterval(com.google.protobuf.Duration value) { - if (expirationIntervalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expirationInterval_ = value; - onChanged(); - } else { - expirationIntervalBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public Builder setExpirationInterval( - com.google.protobuf.Duration.Builder builderForValue) { - if (expirationIntervalBuilder_ == null) { - expirationInterval_ = builderForValue.build(); - onChanged(); - } else { - expirationIntervalBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public Builder mergeExpirationInterval(com.google.protobuf.Duration value) { - if (expirationIntervalBuilder_ == null) { - if (expirationInterval_ != null) { - expirationInterval_ = - com.google.protobuf.Duration.newBuilder(expirationInterval_).mergeFrom(value).buildPartial(); - } else { - expirationInterval_ = value; - } - onChanged(); - } else { - expirationIntervalBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public Builder clearExpirationInterval() { - if (expirationIntervalBuilder_ == null) { - expirationInterval_ = null; - onChanged(); - } else { - expirationInterval_ = null; - expirationIntervalBuilder_ = null; - } - - return this; - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public com.google.protobuf.Duration.Builder getExpirationIntervalBuilder() { - - onChanged(); - return getExpirationIntervalFieldBuilder().getBuilder(); - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - public com.google.protobuf.DurationOrBuilder getExpirationIntervalOrBuilder() { - if (expirationIntervalBuilder_ != null) { - return expirationIntervalBuilder_.getMessageOrBuilder(); - } else { - return expirationInterval_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : expirationInterval_; - } - } - /** - *
-     * Indicates the amount of time that the client should consider this server
-     * list as valid. It may be considered stale after waiting this interval of
-     * time after receiving the list. If the interval is not positive, the
-     * client can assume the list is valid until the next list is received.
-     * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getExpirationIntervalFieldBuilder() { - if (expirationIntervalBuilder_ == null) { - expirationIntervalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getExpirationInterval(), - getParentForChildren(), - isClean()); - expirationInterval_ = null; - } - return expirationIntervalBuilder_; - } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; diff --git a/grpclb/src/generated/main/java/io/grpc/grpclb/ServerListOrBuilder.java b/grpclb/src/generated/main/java/io/grpc/grpclb/ServerListOrBuilder.java index 883b5986c9..4879fe3d23 100644 --- a/grpclb/src/generated/main/java/io/grpc/grpclb/ServerListOrBuilder.java +++ b/grpclb/src/generated/main/java/io/grpc/grpclb/ServerListOrBuilder.java @@ -65,38 +65,4 @@ public interface ServerListOrBuilder extends */ io.grpc.grpclb.ServerOrBuilder getServersOrBuilder( int index); - - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - boolean hasExpirationInterval(); - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - com.google.protobuf.Duration getExpirationInterval(); - /** - *
-   * Indicates the amount of time that the client should consider this server
-   * list as valid. It may be considered stale after waiting this interval of
-   * time after receiving the list. If the interval is not positive, the
-   * client can assume the list is valid until the next list is received.
-   * 
- * - * .google.protobuf.Duration expiration_interval = 3; - */ - com.google.protobuf.DurationOrBuilder getExpirationIntervalOrBuilder(); } diff --git a/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java b/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java index e38a34748d..39c4368a65 100644 --- a/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java +++ b/grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java @@ -336,7 +336,6 @@ final class GrpclbState { new HashMap(); List newDropList = new ArrayList(); List newBackendList = new ArrayList(); - // TODO(zhangkun83): honor expiration_interval // Construct the new collections. Create new Subchannels when necessary. for (Server server : serverList.getServersList()) { String token = server.getLoadBalanceToken(); diff --git a/grpclb/src/main/proto/load_balancer.proto b/grpclb/src/main/proto/load_balancer.proto index c7bf80866b..348564776c 100644 --- a/grpclb/src/main/proto/load_balancer.proto +++ b/grpclb/src/main/proto/load_balancer.proto @@ -100,11 +100,8 @@ message ServerList { // unless instructed otherwise via the client_config. repeated Server servers = 1; - // Indicates the amount of time that the client should consider this server - // list as valid. It may be considered stale after waiting this interval of - // time after receiving the list. If the interval is not positive, the - // client can assume the list is valid until the next list is received. - google.protobuf.Duration expiration_interval = 3; + // Was google.protobuf.Duration expiration_interval. + reserved 3; } // Contains server information. When the drop field is not true, use the other