Search in sources :

Example 41 with Channel

use of io.grpc.Channel in project dble by actiontech.

the class UOffLineListener method init.

public void init() {
    Channel channel = ManagedChannelBuilder.forAddress(UcoreConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_IP), Integer.parseInt(UcoreConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
    stub = UcoreGrpc.newBlockingStub(channel);
}
Also used : Channel(io.grpc.Channel)

Example 42 with Channel

use of io.grpc.Channel in project dble by actiontech.

the class UcoreSingleKeyListener method init.

public void init() {
    Channel channel = ManagedChannelBuilder.forAddress(UcoreConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_IP), Integer.parseInt(UcoreConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_PLUGINS_PORT))).usePlaintext(true).build();
    stub = UcoreGrpc.newBlockingStub(channel);
}
Also used : Channel(io.grpc.Channel)

Example 43 with Channel

use of io.grpc.Channel in project pinpoint by naver.

the class UnaryCallDeadlineInterceptorTest method withoutDeadlineTest.

@Test
public void withoutDeadlineTest() {
    Channel channel = new TestChannel();
    UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(5000);
    unaryCallDeadlineInterceptor.interceptCall(createMethodDescritor(MethodDescriptor.MethodType.BIDI_STREAMING), CallOptions.DEFAULT.withAuthority("test"), channel);
    Assert.assertNull(((TestChannel) channel).callOptions.getDeadline());
}
Also used : Channel(io.grpc.Channel) Test(org.junit.Test)

Example 44 with Channel

use of io.grpc.Channel in project pinpoint by naver.

the class UnaryCallDeadlineInterceptorTest method withDeadlineTest.

@Test
public void withDeadlineTest() {
    Channel channel = new TestChannel();
    UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(5000);
    ClientCall<PAgentInfo, PResult> pAgentInfoPResultClientCall = unaryCallDeadlineInterceptor.interceptCall(createMethodDescritor(MethodDescriptor.MethodType.UNARY), CallOptions.DEFAULT.withAuthority("test"), channel);
    Assert.assertNotNull(((TestChannel) channel).callOptions.getDeadline());
}
Also used : Channel(io.grpc.Channel) PResult(com.navercorp.pinpoint.grpc.trace.PResult) PAgentInfo(com.navercorp.pinpoint.grpc.trace.PAgentInfo) Test(org.junit.Test)

Example 45 with Channel

use of io.grpc.Channel in project beam by apache.

the class GrpcWindmillServer method initializeLocalHost.

private synchronized void initializeLocalHost(int port) throws IOException {
    this.logEveryNStreamFailures = 1;
    this.maxBackoff = Duration.millis(500);
    // For local testing use short deadlines.
    this.unaryDeadlineSeconds = 10;
    Channel channel = localhostChannel(port);
    if (streamingEngineEnabled()) {
        this.stubList.add(CloudWindmillServiceV1Alpha1Grpc.newStub(channel));
        this.syncStubList.add(CloudWindmillServiceV1Alpha1Grpc.newBlockingStub(channel));
    } else {
        this.syncApplianceStub = WindmillApplianceGrpc.newBlockingStub(channel);
    }
}
Also used : Channel(org.apache.beam.vendor.grpc.v1p43p2.io.grpc.Channel)

Aggregations

Channel (io.grpc.Channel)60 CallOptions (io.grpc.CallOptions)37 Test (org.junit.Test)33 Metadata (io.grpc.Metadata)25 MethodDescriptor (io.grpc.MethodDescriptor)20 ClientInterceptor (io.grpc.ClientInterceptor)19 ManagedChannel (io.grpc.ManagedChannel)17 ClientCall (io.grpc.ClientCall)14 SocketAddress (java.net.SocketAddress)8 ByteString (com.google.protobuf.ByteString)7 SimpleForwardingClientCall (io.grpc.ForwardingClientCall.SimpleForwardingClientCall)7 NoopClientCall (io.grpc.internal.NoopClientCall)6 AtomicReference (java.util.concurrent.atomic.AtomicReference)6 Duration (com.google.protobuf.Duration)5 ChannelLogger (io.grpc.ChannelLogger)5 Status (io.grpc.Status)5 ClientStreamTracer (io.grpc.ClientStreamTracer)4 ForwardingClientCall (io.grpc.ForwardingClientCall)4 SimpleForwardingClientCallListener (io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener)4 Subchannel (io.grpc.LoadBalancer.Subchannel)4