tensorflow.TPUProfilerGrpc Maven / Gradle / Ivy
The newest version!
package tensorflow;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*
* The TPUProfiler service retrieves performance information about
* the programs running on connected TPUs over a period of time.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.18.0)",
comments = "Source: tensorflow/contrib/tpu/profiler/tpu_profiler.proto")
public final class TPUProfilerGrpc {
private TPUProfilerGrpc() {}
public static final String SERVICE_NAME = "tensorflow.TPUProfiler";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getProfileMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Profile",
requestType = tensorflow.TpuProfiler.ProfileRequest.class,
responseType = tensorflow.TpuProfiler.ProfileResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getProfileMethod() {
io.grpc.MethodDescriptor getProfileMethod;
if ((getProfileMethod = TPUProfilerGrpc.getProfileMethod) == null) {
synchronized (TPUProfilerGrpc.class) {
if ((getProfileMethod = TPUProfilerGrpc.getProfileMethod) == null) {
TPUProfilerGrpc.getProfileMethod = getProfileMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"tensorflow.TPUProfiler", "Profile"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
tensorflow.TpuProfiler.ProfileRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
tensorflow.TpuProfiler.ProfileResponse.getDefaultInstance()))
.setSchemaDescriptor(new TPUProfilerMethodDescriptorSupplier("Profile"))
.build();
}
}
}
return getProfileMethod;
}
private static volatile io.grpc.MethodDescriptor getMonitorMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Monitor",
requestType = tensorflow.TpuProfiler.MonitorRequest.class,
responseType = tensorflow.TpuProfiler.MonitorResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getMonitorMethod() {
io.grpc.MethodDescriptor getMonitorMethod;
if ((getMonitorMethod = TPUProfilerGrpc.getMonitorMethod) == null) {
synchronized (TPUProfilerGrpc.class) {
if ((getMonitorMethod = TPUProfilerGrpc.getMonitorMethod) == null) {
TPUProfilerGrpc.getMonitorMethod = getMonitorMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"tensorflow.TPUProfiler", "Monitor"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
tensorflow.TpuProfiler.MonitorRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
tensorflow.TpuProfiler.MonitorResponse.getDefaultInstance()))
.setSchemaDescriptor(new TPUProfilerMethodDescriptorSupplier("Monitor"))
.build();
}
}
}
return getMonitorMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static TPUProfilerStub newStub(io.grpc.Channel channel) {
return new TPUProfilerStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static TPUProfilerBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new TPUProfilerBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static TPUProfilerFutureStub newFutureStub(
io.grpc.Channel channel) {
return new TPUProfilerFutureStub(channel);
}
/**
*
* The TPUProfiler service retrieves performance information about
* the programs running on connected TPUs over a period of time.
*
*/
public static abstract class TPUProfilerImplBase implements io.grpc.BindableService {
/**
*
* Starts a profiling session, blocks until it completes, and returns data.
*
*/
public void profile(tensorflow.TpuProfiler.ProfileRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getProfileMethod(), responseObserver);
}
/**
*
* Collects profiling data and returns user-friendly metrics.
*
*/
public void monitor(tensorflow.TpuProfiler.MonitorRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getMonitorMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getProfileMethod(),
asyncUnaryCall(
new MethodHandlers<
tensorflow.TpuProfiler.ProfileRequest,
tensorflow.TpuProfiler.ProfileResponse>(
this, METHODID_PROFILE)))
.addMethod(
getMonitorMethod(),
asyncUnaryCall(
new MethodHandlers<
tensorflow.TpuProfiler.MonitorRequest,
tensorflow.TpuProfiler.MonitorResponse>(
this, METHODID_MONITOR)))
.build();
}
}
/**
*
* The TPUProfiler service retrieves performance information about
* the programs running on connected TPUs over a period of time.
*
*/
public static final class TPUProfilerStub extends io.grpc.stub.AbstractStub {
private TPUProfilerStub(io.grpc.Channel channel) {
super(channel);
}
private TPUProfilerStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TPUProfilerStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TPUProfilerStub(channel, callOptions);
}
/**
*
* Starts a profiling session, blocks until it completes, and returns data.
*
*/
public void profile(tensorflow.TpuProfiler.ProfileRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getProfileMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* Collects profiling data and returns user-friendly metrics.
*
*/
public void monitor(tensorflow.TpuProfiler.MonitorRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getMonitorMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
* The TPUProfiler service retrieves performance information about
* the programs running on connected TPUs over a period of time.
*
*/
public static final class TPUProfilerBlockingStub extends io.grpc.stub.AbstractStub {
private TPUProfilerBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private TPUProfilerBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TPUProfilerBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TPUProfilerBlockingStub(channel, callOptions);
}
/**
*
* Starts a profiling session, blocks until it completes, and returns data.
*
*/
public tensorflow.TpuProfiler.ProfileResponse profile(tensorflow.TpuProfiler.ProfileRequest request) {
return blockingUnaryCall(
getChannel(), getProfileMethod(), getCallOptions(), request);
}
/**
*
* Collects profiling data and returns user-friendly metrics.
*
*/
public tensorflow.TpuProfiler.MonitorResponse monitor(tensorflow.TpuProfiler.MonitorRequest request) {
return blockingUnaryCall(
getChannel(), getMonitorMethod(), getCallOptions(), request);
}
}
/**
*
* The TPUProfiler service retrieves performance information about
* the programs running on connected TPUs over a period of time.
*
*/
public static final class TPUProfilerFutureStub extends io.grpc.stub.AbstractStub {
private TPUProfilerFutureStub(io.grpc.Channel channel) {
super(channel);
}
private TPUProfilerFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected TPUProfilerFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new TPUProfilerFutureStub(channel, callOptions);
}
/**
*
* Starts a profiling session, blocks until it completes, and returns data.
*
*/
public com.google.common.util.concurrent.ListenableFuture profile(
tensorflow.TpuProfiler.ProfileRequest request) {
return futureUnaryCall(
getChannel().newCall(getProfileMethod(), getCallOptions()), request);
}
/**
*
* Collects profiling data and returns user-friendly metrics.
*
*/
public com.google.common.util.concurrent.ListenableFuture monitor(
tensorflow.TpuProfiler.MonitorRequest request) {
return futureUnaryCall(
getChannel().newCall(getMonitorMethod(), getCallOptions()), request);
}
}
private static final int METHODID_PROFILE = 0;
private static final int METHODID_MONITOR = 1;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final TPUProfilerImplBase serviceImpl;
private final int methodId;
MethodHandlers(TPUProfilerImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_PROFILE:
serviceImpl.profile((tensorflow.TpuProfiler.ProfileRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_MONITOR:
serviceImpl.monitor((tensorflow.TpuProfiler.MonitorRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class TPUProfilerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
TPUProfilerBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return tensorflow.TpuProfiler.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("TPUProfiler");
}
}
private static final class TPUProfilerFileDescriptorSupplier
extends TPUProfilerBaseDescriptorSupplier {
TPUProfilerFileDescriptorSupplier() {}
}
private static final class TPUProfilerMethodDescriptorSupplier
extends TPUProfilerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
TPUProfilerMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (TPUProfilerGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new TPUProfilerFileDescriptorSupplier())
.addMethod(getProfileMethod())
.addMethod(getMonitorMethod())
.build();
}
}
}
return result;
}
}