aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/proto
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2018-06-21 15:15:10 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2018-06-21 17:46:31 -0700
commitf3955ba7119f8433fc6a0fba6cf1a075ea5a4f2a (patch)
tree6eb6da4d55b685d29e3aa7d88c5d1bcadf7d3f3f /src/proto
parentfd7683c7de14fd93f9696e3aee8abf51d64745b3 (diff)
Update to use the canonical version of LB proto
Diffstat (limited to 'src/proto')
-rw-r--r--src/proto/grpc/lb/v1/BUILD10
-rw-r--r--src/proto/grpc/lb/v1/load_balancer.proto63
2 files changed, 30 insertions, 43 deletions
diff --git a/src/proto/grpc/lb/v1/BUILD b/src/proto/grpc/lb/v1/BUILD
index 15bf3c3233..91e79610b5 100644
--- a/src/proto/grpc/lb/v1/BUILD
+++ b/src/proto/grpc/lb/v1/BUILD
@@ -16,9 +16,15 @@ licenses(["notice"]) # Apache v2
load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package")
-grpc_package(name = "lb", visibility = "public")
+grpc_package(
+ name = "lb",
+ visibility = "public",
+)
grpc_proto_library(
name = "load_balancer_proto",
- srcs = ["load_balancer.proto"],
+ srcs = [
+ "load_balancer.proto",
+ ],
+ well_known_protos = True,
)
diff --git a/src/proto/grpc/lb/v1/load_balancer.proto b/src/proto/grpc/lb/v1/load_balancer.proto
index 3e0a4b2c97..8b1e55e066 100644
--- a/src/proto/grpc/lb/v1/load_balancer.proto
+++ b/src/proto/grpc/lb/v1/load_balancer.proto
@@ -1,4 +1,4 @@
-// Copyright 2016 gRPC authors.
+// Copyright 2015 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,42 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// This file defines an the GRPCLB LoadBalancing protocol.
+//
+// The canonical version of this proto can be found at
+// https://github.com/grpc/grpc-proto/blob/master/grpc/lb/v1/load_balancer.proto
syntax = "proto3";
package grpc.lb.v1;
-message Duration {
- // Signed seconds of the span of time. Must be from -315,576,000,000
- // to +315,576,000,000 inclusive.
- int64 seconds = 1;
-
- // Signed fractions of a second at nanosecond resolution of the span
- // of time. Durations less than one second are represented with a 0
- // `seconds` field and a positive or negative `nanos` field. For durations
- // of one second or more, a non-zero value for the `nanos` field must be
- // of the same sign as the `seconds` field. Must be from -999,999,999
- // to +999,999,999 inclusive.
- int32 nanos = 2;
-}
-
-message Timestamp {
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
- // Represents seconds of UTC time since Unix epoch
- // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
- // 9999-12-31T23:59:59Z inclusive.
- int64 seconds = 1;
-
- // Non-negative fractions of a second at nanosecond resolution. Negative
- // second values with fractions must still have non-negative nanos values
- // that count forward in time. Must be from 0 to 999,999,999
- // inclusive.
- int32 nanos = 2;
-}
+option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1";
+option java_multiple_files = true;
+option java_outer_classname = "LoadBalancerProto";
+option java_package = "io.grpc.grpclb";
service LoadBalancer {
// Bidirectional rpc to get a list of servers.
- rpc BalanceLoad(stream LoadBalanceRequest)
- returns (stream LoadBalanceResponse);
+ rpc BalanceLoad(stream LoadBalanceRequest) returns (stream LoadBalanceResponse);
}
message LoadBalanceRequest {
@@ -62,10 +45,8 @@ message LoadBalanceRequest {
}
message InitialLoadBalanceRequest {
- // The name of the load balanced service (e.g., balancer.service.com). The max
- // length of the name is 256 bytes.
- // The name might include a port number. How to handle the port number is up
- // to the balancer.
+ // Name of load balanced service (IE, service.googleapis.com). Its
+ // length should be less than 256 bytes.
string name = 1;
}
@@ -82,7 +63,7 @@ message ClientStatsPerToken {
// count except the timestamp should be reset to zero after reporting the stats.
message ClientStats {
// The timestamp of generating the report.
- Timestamp timestamp = 1;
+ google.protobuf.Timestamp timestamp = 1;
// The total number of RPCs that started.
int64 num_calls_started = 2;
@@ -125,7 +106,7 @@ message InitialLoadBalanceResponse {
// This interval defines how often the client should send the client stats
// to the load balancer. Stats should only be reported when the duration is
// positive.
- Duration client_stats_report_interval = 2;
+ google.protobuf.Duration client_stats_report_interval = 2;
}
message ServerList {
@@ -149,13 +130,13 @@ message Server {
// A resolved port number for the server.
int32 port = 2;
- // An opaque but printable token given to the frontend for each pick. All
- // frontend requests for that pick must include the token in its initial
- // metadata. The token is used by the backend to verify the request and to
- // allow the backend to report load to the gRPC LB system. The token is also
- // used in client stats for reporting dropped calls.
+ // An opaque but printable token for load reporting. The client must include
+ // the token of the picked server into the initial metadata when it starts a
+ // call to that server. The token is used by the server to verify the request
+ // and to allow the server to report load to the gRPC LB system. The token is
+ // also used in client stats for reporting dropped calls.
//
- // Its length is variable but less than 50 bytes.
+ // Its length can be variable but must be less than 50 bytes.
string load_balance_token = 3;
// Indicates whether this particular request should be dropped by the client.