Skip to content

Commit

Permalink
interop-testing: add proto definitions for xDS circuit breaking test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
voidzcy committed Oct 22, 2020
1 parent 641c54e commit f5c7f4e
Show file tree
Hide file tree
Showing 4 changed files with 449 additions and 1 deletion.
Expand Up @@ -61,6 +61,37 @@ io.grpc.testing.integration.Messages.LoadBalancerStatsResponse> getGetClientStat
return getGetClientStatsMethod;
}

private static volatile io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest,
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> getGetClientAccumulatedStatsMethod;

@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetClientAccumulatedStats",
requestType = io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest.class,
responseType = io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest,
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> getGetClientAccumulatedStatsMethod() {
io.grpc.MethodDescriptor<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> getGetClientAccumulatedStatsMethod;
if ((getGetClientAccumulatedStatsMethod = LoadBalancerStatsServiceGrpc.getGetClientAccumulatedStatsMethod) == null) {
synchronized (LoadBalancerStatsServiceGrpc.class) {
if ((getGetClientAccumulatedStatsMethod = LoadBalancerStatsServiceGrpc.getGetClientAccumulatedStatsMethod) == null) {
LoadBalancerStatsServiceGrpc.getGetClientAccumulatedStatsMethod = getGetClientAccumulatedStatsMethod =
io.grpc.MethodDescriptor.<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest, io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetClientAccumulatedStats"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse.getDefaultInstance()))
.setSchemaDescriptor(new LoadBalancerStatsServiceMethodDescriptorSupplier("GetClientAccumulatedStats"))
.build();
}
}
}
return getGetClientAccumulatedStatsMethod;
}

/**
* Creates a new async stub that supports all call types for the service
*/
Expand Down Expand Up @@ -122,6 +153,16 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat
asyncUnimplementedUnaryCall(getGetClientStatsMethod(), responseObserver);
}

/**
* <pre>
* Gets the accumulated stats for RPCs sent by a test client.
* </pre>
*/
public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> responseObserver) {
asyncUnimplementedUnaryCall(getGetClientAccumulatedStatsMethod(), responseObserver);
}

@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
Expand All @@ -131,6 +172,13 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat
io.grpc.testing.integration.Messages.LoadBalancerStatsRequest,
io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>(
this, METHODID_GET_CLIENT_STATS)))
.addMethod(
getGetClientAccumulatedStatsMethod(),
asyncUnaryCall(
new MethodHandlers<
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest,
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>(
this, METHODID_GET_CLIENT_ACCUMULATED_STATS)))
.build();
}
}
Expand Down Expand Up @@ -162,6 +210,17 @@ public void getClientStats(io.grpc.testing.integration.Messages.LoadBalancerStat
asyncUnaryCall(
getChannel().newCall(getGetClientStatsMethod(), getCallOptions()), request, responseObserver);
}

/**
* <pre>
* Gets the accumulated stats for RPCs sent by a test client.
* </pre>
*/
public void getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> responseObserver) {
asyncUnaryCall(
getChannel().newCall(getGetClientAccumulatedStatsMethod(), getCallOptions()), request, responseObserver);
}
}

/**
Expand Down Expand Up @@ -190,6 +249,16 @@ public io.grpc.testing.integration.Messages.LoadBalancerStatsResponse getClientS
return blockingUnaryCall(
getChannel(), getGetClientStatsMethod(), getCallOptions(), request);
}

/**
* <pre>
* Gets the accumulated stats for RPCs sent by a test client.
* </pre>
*/
public io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse getClientAccumulatedStats(io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) {
return blockingUnaryCall(
getChannel(), getGetClientAccumulatedStatsMethod(), getCallOptions(), request);
}
}

/**
Expand Down Expand Up @@ -219,9 +288,21 @@ public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integr
return futureUnaryCall(
getChannel().newCall(getGetClientStatsMethod(), getCallOptions()), request);
}

/**
* <pre>
* Gets the accumulated stats for RPCs sent by a test client.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse> getClientAccumulatedStats(
io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest request) {
return futureUnaryCall(
getChannel().newCall(getGetClientAccumulatedStatsMethod(), getCallOptions()), request);
}
}

private static final int METHODID_GET_CLIENT_STATS = 0;
private static final int METHODID_GET_CLIENT_ACCUMULATED_STATS = 1;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand All @@ -244,6 +325,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
serviceImpl.getClientStats((io.grpc.testing.integration.Messages.LoadBalancerStatsRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.LoadBalancerStatsResponse>) responseObserver);
break;
case METHODID_GET_CLIENT_ACCUMULATED_STATS:
serviceImpl.getClientAccumulatedStats((io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.Messages.LoadBalancerAccumulatedStatsResponse>) responseObserver);
break;
default:
throw new AssertionError();
}
Expand Down Expand Up @@ -306,6 +391,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new LoadBalancerStatsServiceFileDescriptorSupplier())
.addMethod(getGetClientStatsMethod())
.addMethod(getGetClientAccumulatedStatsMethod())
.build();
}
}
Expand Down

0 comments on commit f5c7f4e

Please sign in to comment.