Search in sources :

Example 1 with DefaultChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder in project pinpoint by naver.

the class MetadataClientMock method newChannelFactory.

private ChannelFactory newChannelFactory() {
    HeaderFactory headerFactory = new AgentHeaderFactory("mockAgentId", "mockAgentName", "mockApplicationName", ServiceType.UNDEFINED.getCode(), System.currentTimeMillis());
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataClientMock");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setClientOption(new ClientOption());
    return channelFactoryBuilder.build();
}
Also used : HeaderFactory(com.navercorp.pinpoint.grpc.client.HeaderFactory) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 2 with DefaultChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder in project pinpoint by naver.

the class SpanClientMock method newChannelFactory.

private ChannelFactory newChannelFactory() {
    HeaderFactory headerFactory = new AgentHeaderFactory("mockAgentId", "mockAgentName", "mockApplicationName", ServiceType.UNDEFINED.getCode(), System.currentTimeMillis());
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("SpanClientMock");
    final ClientInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(1000);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    final ClientInterceptor discardClientInterceptor = newDiscardClientInterceptor();
    channelFactoryBuilder.addClientInterceptor(discardClientInterceptor);
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setClientOption(new ClientOption());
    return channelFactoryBuilder.build();
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) DiscardClientInterceptor(com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor) ClientInterceptor(io.grpc.ClientInterceptor) HeaderFactory(com.navercorp.pinpoint.grpc.client.HeaderFactory) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 3 with DefaultChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder in project pinpoint by naver.

the class AgentGrpcDataSenderProvider method newChannelFactoryBuilder.

ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getAgentChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getAgentRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getAgentClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("AgentGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 4 with DefaultChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder in project pinpoint by naver.

the class MetadataGrpcDataSenderProvider method newChannelFactoryBuilder.

protected ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getMetadataChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getMetadataRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getMetadataClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 5 with DefaultChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder in project pinpoint by naver.

the class StatGrpcDataSenderProvider method newChannelFactoryBuilder.

private ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getStatChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getStatRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getStatClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("StatGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)8 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)8 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)8 UnaryCallDeadlineInterceptor (com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor)5 ClientInterceptor (io.grpc.ClientInterceptor)5 HeaderFactory (com.navercorp.pinpoint.grpc.client.HeaderFactory)4 SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)4 AgentHeaderFactory (com.navercorp.pinpoint.grpc.AgentHeaderFactory)3 ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)2 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)2 Empty (com.google.protobuf.Empty)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 PSpan (com.navercorp.pinpoint.grpc.trace.PSpan)1 PSpanMessage (com.navercorp.pinpoint.grpc.trace.PSpanMessage)1 SpanGrpc (com.navercorp.pinpoint.grpc.trace.SpanGrpc)1 GrpcMetadataMessageConverter (com.navercorp.pinpoint.profiler.context.grpc.GrpcMetadataMessageConverter)1 DnsExecutorServiceProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.DnsExecutorServiceProvider)1 GrpcNameResolverProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.GrpcNameResolverProvider)1 AgentInfo (com.navercorp.pinpoint.profiler.metadata.AgentInfo)1 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)1