beaker.server.protobuf.BeakerGrpc.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beaker-protobuf Show documentation
Show all versions of beaker-protobuf Show documentation
Reinventing database transactions
The newest version!
package beaker.server.protobuf
object BeakerGrpc {
val METHOD_GET: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Keys, beaker.server.protobuf.Revisions] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Get"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Keys))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Revisions))
.build()
val METHOD_SCAN: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Range, beaker.server.protobuf.Revisions] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Scan"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Range))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Revisions))
.build()
val METHOD_NETWORK: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Void, beaker.server.protobuf.View] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Network"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Void))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.View))
.build()
val METHOD_RECONFIGURE: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Configuration, beaker.server.protobuf.Result] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Reconfigure"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Configuration))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Result))
.build()
val METHOD_PROPOSE: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Transaction, beaker.server.protobuf.Result] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Propose"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Transaction))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Result))
.build()
val METHOD_PREPARE: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Proposal, beaker.server.protobuf.Proposal] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Prepare"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Proposal))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Proposal))
.build()
val METHOD_ACCEPT: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Proposal, beaker.server.protobuf.Result] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Accept"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Proposal))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Result))
.build()
val METHOD_LEARN: _root_.io.grpc.MethodDescriptor[beaker.server.protobuf.Proposal, beaker.server.protobuf.Void] =
_root_.io.grpc.MethodDescriptor.newBuilder()
.setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("beaker.server.protobuf.Beaker", "Learn"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Proposal))
.setResponseMarshaller(new scalapb.grpc.Marshaller(beaker.server.protobuf.Void))
.build()
val SERVICE: _root_.io.grpc.ServiceDescriptor =
_root_.io.grpc.ServiceDescriptor.newBuilder("beaker.server.protobuf.Beaker")
.setSchemaDescriptor(new _root_.scalapb.grpc.ConcreteProtoFileDescriptorSupplier(beaker.server.protobuf.BeakerProto.javaDescriptor))
.addMethod(METHOD_GET)
.addMethod(METHOD_SCAN)
.addMethod(METHOD_NETWORK)
.addMethod(METHOD_RECONFIGURE)
.addMethod(METHOD_PROPOSE)
.addMethod(METHOD_PREPARE)
.addMethod(METHOD_ACCEPT)
.addMethod(METHOD_LEARN)
.build()
trait Beaker extends _root_.scalapb.grpc.AbstractService {
override def serviceCompanion = Beaker
def get(request: beaker.server.protobuf.Keys): scala.concurrent.Future[beaker.server.protobuf.Revisions]
def scan(responseObserver: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Revisions]): _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Range]
def network(request: beaker.server.protobuf.Void): scala.concurrent.Future[beaker.server.protobuf.View]
def reconfigure(request: beaker.server.protobuf.Configuration): scala.concurrent.Future[beaker.server.protobuf.Result]
def propose(request: beaker.server.protobuf.Transaction): scala.concurrent.Future[beaker.server.protobuf.Result]
def prepare(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Proposal]
def accept(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Result]
def learn(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Void]
}
object Beaker extends _root_.scalapb.grpc.ServiceCompanion[Beaker] {
implicit def serviceCompanion: _root_.scalapb.grpc.ServiceCompanion[Beaker] = this
def javaDescriptor: _root_.com.google.protobuf.Descriptors.ServiceDescriptor = beaker.server.protobuf.BeakerProto.javaDescriptor.getServices().get(0)
}
trait BeakerBlockingClient {
def serviceCompanion = Beaker
def get(request: beaker.server.protobuf.Keys): beaker.server.protobuf.Revisions
def network(request: beaker.server.protobuf.Void): beaker.server.protobuf.View
def reconfigure(request: beaker.server.protobuf.Configuration): beaker.server.protobuf.Result
def propose(request: beaker.server.protobuf.Transaction): beaker.server.protobuf.Result
def prepare(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Proposal
def accept(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Result
def learn(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Void
}
class BeakerBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[BeakerBlockingStub](channel, options) with BeakerBlockingClient {
override def get(request: beaker.server.protobuf.Keys): beaker.server.protobuf.Revisions = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_GET, options), request)
}
override def network(request: beaker.server.protobuf.Void): beaker.server.protobuf.View = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_NETWORK, options), request)
}
override def reconfigure(request: beaker.server.protobuf.Configuration): beaker.server.protobuf.Result = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_RECONFIGURE, options), request)
}
override def propose(request: beaker.server.protobuf.Transaction): beaker.server.protobuf.Result = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_PROPOSE, options), request)
}
override def prepare(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Proposal = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_PREPARE, options), request)
}
override def accept(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Result = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_ACCEPT, options), request)
}
override def learn(request: beaker.server.protobuf.Proposal): beaker.server.protobuf.Void = {
_root_.io.grpc.stub.ClientCalls.blockingUnaryCall(channel.newCall(METHOD_LEARN, options), request)
}
override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): BeakerBlockingStub = new BeakerBlockingStub(channel, options)
}
class BeakerStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[BeakerStub](channel, options) with Beaker {
override def get(request: beaker.server.protobuf.Keys): scala.concurrent.Future[beaker.server.protobuf.Revisions] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_GET, options), request))
}
override def scan(responseObserver: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Revisions]): _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Range] = {
_root_.io.grpc.stub.ClientCalls.asyncBidiStreamingCall(channel.newCall(METHOD_SCAN, options), responseObserver)
}
override def network(request: beaker.server.protobuf.Void): scala.concurrent.Future[beaker.server.protobuf.View] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_NETWORK, options), request))
}
override def reconfigure(request: beaker.server.protobuf.Configuration): scala.concurrent.Future[beaker.server.protobuf.Result] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_RECONFIGURE, options), request))
}
override def propose(request: beaker.server.protobuf.Transaction): scala.concurrent.Future[beaker.server.protobuf.Result] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_PROPOSE, options), request))
}
override def prepare(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Proposal] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_PREPARE, options), request))
}
override def accept(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Result] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_ACCEPT, options), request))
}
override def learn(request: beaker.server.protobuf.Proposal): scala.concurrent.Future[beaker.server.protobuf.Void] = {
scalapb.grpc.Grpc.guavaFuture2ScalaFuture(_root_.io.grpc.stub.ClientCalls.futureUnaryCall(channel.newCall(METHOD_LEARN, options), request))
}
override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): BeakerStub = new BeakerStub(channel, options)
}
def bindService(serviceImpl: Beaker, executionContext: scala.concurrent.ExecutionContext): _root_.io.grpc.ServerServiceDefinition =
_root_.io.grpc.ServerServiceDefinition.builder(SERVICE)
.addMethod(
METHOD_GET,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Keys, beaker.server.protobuf.Revisions] {
override def invoke(request: beaker.server.protobuf.Keys, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Revisions]): Unit =
serviceImpl.get(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_SCAN,
_root_.io.grpc.stub.ServerCalls.asyncBidiStreamingCall(new _root_.io.grpc.stub.ServerCalls.BidiStreamingMethod[beaker.server.protobuf.Range, beaker.server.protobuf.Revisions] {
override def invoke(observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Revisions]): _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Range] =
serviceImpl.scan(observer)
}))
.addMethod(
METHOD_NETWORK,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Void, beaker.server.protobuf.View] {
override def invoke(request: beaker.server.protobuf.Void, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.View]): Unit =
serviceImpl.network(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_RECONFIGURE,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Configuration, beaker.server.protobuf.Result] {
override def invoke(request: beaker.server.protobuf.Configuration, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Result]): Unit =
serviceImpl.reconfigure(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_PROPOSE,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Transaction, beaker.server.protobuf.Result] {
override def invoke(request: beaker.server.protobuf.Transaction, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Result]): Unit =
serviceImpl.propose(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_PREPARE,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Proposal, beaker.server.protobuf.Proposal] {
override def invoke(request: beaker.server.protobuf.Proposal, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Proposal]): Unit =
serviceImpl.prepare(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_ACCEPT,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Proposal, beaker.server.protobuf.Result] {
override def invoke(request: beaker.server.protobuf.Proposal, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Result]): Unit =
serviceImpl.accept(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.addMethod(
METHOD_LEARN,
_root_.io.grpc.stub.ServerCalls.asyncUnaryCall(new _root_.io.grpc.stub.ServerCalls.UnaryMethod[beaker.server.protobuf.Proposal, beaker.server.protobuf.Void] {
override def invoke(request: beaker.server.protobuf.Proposal, observer: _root_.io.grpc.stub.StreamObserver[beaker.server.protobuf.Void]): Unit =
serviceImpl.learn(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))(
executionContext)
}))
.build()
def blockingStub(channel: _root_.io.grpc.Channel): BeakerBlockingStub = new BeakerBlockingStub(channel)
def stub(channel: _root_.io.grpc.Channel): BeakerStub = new BeakerStub(channel)
def javaDescriptor: _root_.com.google.protobuf.Descriptors.ServiceDescriptor = beaker.server.protobuf.BeakerProto.javaDescriptor.getServices().get(0)
}