use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.ManagedChannel in project zipkin-gcp by openzipkin.
the class StackdriverSender method newBuilder.
public static Builder newBuilder() {
ManagedChannel channel = ManagedChannelBuilder.forTarget("cloudtrace.googleapis.com").build();
Builder result = newBuilder(channel);
result.shutdownChannelOnClose = true;
return result;
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.ManagedChannel in project sample-googleassistant by androidthings.
the class EmbeddedAssistant method connect.
/**
* Initializes the Assistant.
*/
public void connect() {
mAssistantThread = new HandlerThread("assistantThread");
mAssistantThread.start();
mAssistantHandler = new Handler(mAssistantThread.getLooper());
ManagedChannel channel = ManagedChannelBuilder.forTarget(ASSISTANT_API_ENDPOINT).build();
mAssistantService = EmbeddedAssistantGrpc.newStub(channel).withCallCredentials(MoreCallCredentials.from(mUserCredentials));
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.ManagedChannel in project seldon-core by SeldonIO.
the class SeldonGrpcServer method deploymentAdded.
public void deploymentAdded(SeldonDeployment resource) {
ManagedChannel channel = ManagedChannelBuilder.forAddress(resource.getSpec().getName(), appProperties.getEngineGrpcContainerPort()).usePlaintext(true).build();
channelStore.put(resource.getSpec().getOauthKey(), channel);
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.ManagedChannel in project seldon-core by SeldonIO.
the class SeldonGrpcServer method getChannel.
/**
* Using the principal from authorization return a client gRPC channel to connect to the engine running the prediction graph.
* @return ManagedChannel
*/
public ManagedChannel getChannel() {
final String principal = getPrincipal();
if (principal == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_GRPC_NO_PRINCIPAL_FOUND, "");
}
final DeploymentSpec deploymentSpec = deploymentStore.getDeployment(principal);
if (deploymentSpec == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_NO_RUNNING_DEPLOYMENT, "Principal is " + principal);
}
ManagedChannel channel = channelStore.get(principal);
if (channel == null) {
throw new SeldonAPIException(SeldonAPIException.ApiExceptionType.APIFE_GRPC_NO_GRPC_CHANNEL_FOUND, "Principal is " + principal);
}
return channel;
}
use of org.apache.beam.vendor.grpc.v1p43p2.io.grpc.ManagedChannel in project flink by apache.
the class DefaultPubSubSubscriberFactory method getSubscriber.
@Override
public PubSubSubscriber getSubscriber(Credentials credentials) throws IOException {
ManagedChannel channel = NettyChannelBuilder.forTarget(SubscriberStubSettings.getDefaultEndpoint()).negotiationType(NegotiationType.TLS).sslContext(GrpcSslContexts.forClient().ciphers(null).build()).build();
PullRequest pullRequest = PullRequest.newBuilder().setMaxMessages(maxMessagesPerPull).setSubscription(projectSubscriptionName).build();
SubscriberGrpc.SubscriberBlockingStub stub = SubscriberGrpc.newBlockingStub(channel).withCallCredentials(MoreCallCredentials.from(credentials));
return new BlockingGrpcPubSubSubscriber(projectSubscriptionName, channel, stub, pullRequest, retries, timeout);
}
Aggregations