Search in sources :

Example 11 with DefaultPinpointClientFactory

use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.

the class CollectorClusterConnector method start.

@Override
public void start() {
    logger.info("{} initialization started.", ClassUtils.simpleClassName(this));
    ClusterOption clusterOption = new ClusterOption(true, option.getClusterId(), Role.ROUTER);
    this.clientFactory = new DefaultPinpointClientFactory();
    this.clientFactory.setWriteTimeoutMillis(1000 * 3);
    this.clientFactory.setRequestTimeoutMillis(1000 * 5);
    this.clientFactory.setMessageListener(option.getRouteMessageHandler());
    this.clientFactory.setServerStreamChannelMessageHandler(option.getRouteStreamMessageHandler());
    this.clientFactory.setClusterOption(clusterOption);
    Map<String, Object> properties = new HashMap<>();
    properties.put("id", option.getClusterId());
    clientFactory.setProperties(properties);
    logger.info("{} initialization completed.", ClassUtils.simpleClassName(this));
}
Also used : ClusterOption(com.navercorp.pinpoint.rpc.cluster.ClusterOption) DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) HashMap(java.util.HashMap)

Example 12 with DefaultPinpointClientFactory

use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.

the class FlinkClusterConnectionManager method newPointClientFactory.

private PinpointClientFactory newPointClientFactory() {
    PinpointClientFactory pinpointClientFactory = new DefaultPinpointClientFactory();
    pinpointClientFactory.setWriteTimeoutMillis(1000 * 3);
    pinpointClientFactory.setRequestTimeoutMillis(1000 * 5);
    return pinpointClientFactory;
}
Also used : DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory)

Example 13 with DefaultPinpointClientFactory

use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.

the class PinpointClientFactoryProvider method get.

public PinpointClientFactory get() {
    PinpointClientFactory pinpointClientFactory = new DefaultPinpointClientFactory(connectionFactoryProvider.get());
    pinpointClientFactory.setWriteTimeoutMillis(thriftTransportConfig.getTcpDataSenderPinpointClientWriteTimeout());
    pinpointClientFactory.setRequestTimeoutMillis(thriftTransportConfig.getTcpDataSenderPinpointClientRequestTimeout());
    pinpointClientFactory.setReconnectDelay(thriftTransportConfig.getTcpDataSenderPinpointClientReconnectInterval());
    pinpointClientFactory.setPingDelay(thriftTransportConfig.getTcpDataSenderPinpointClientPingInterval());
    pinpointClientFactory.setEnableWorkerPacketDelay(thriftTransportConfig.getTcpDataSenderPinpointClientHandshakeInterval());
    int writeBufferHighWaterMark = getByteSize(thriftTransportConfig.getTcpDataSenderPinpointClientWriteBufferHighWaterMark(), ByteSizeUnit.MEGA_BYTES.toBytesSizeAsInt(32));
    int writeBufferLowWaterMark = getByteSize(thriftTransportConfig.getTcpDataSenderPinpointClientWriteBufferLowWaterMark(), ByteSizeUnit.MEGA_BYTES.toBytesSizeAsInt(16));
    if (writeBufferLowWaterMark > writeBufferHighWaterMark) {
        logger.warn("must be writeBufferHighWaterMark({}) >= writeBufferLowWaterMark({})", writeBufferHighWaterMark, writeBufferLowWaterMark);
        writeBufferLowWaterMark = writeBufferHighWaterMark;
    }
    pinpointClientFactory.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
    pinpointClientFactory.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
    AgentInformation agentInformation = this.agentInformation.get();
    Map<String, Object> properties = toMap(agentInformation);
    boolean isSupportServerMode = thriftTransportConfig.isTcpDataSenderCommandAcceptEnable();
    if (isSupportServerMode) {
        pinpointClientFactory.setMessageListener(commandDispatcher);
        pinpointClientFactory.setServerStreamChannelMessageHandler(commandDispatcher);
        properties.put(HandshakePropertyType.SUPPORT_SERVER.getName(), true);
        properties.put(HandshakePropertyType.SUPPORT_COMMAND_LIST.getName(), commandDispatcher.getRegisteredCommandServiceCodes());
    } else {
        properties.put(HandshakePropertyType.SUPPORT_SERVER.getName(), false);
    }
    pinpointClientFactory.setProperties(properties);
    return pinpointClientFactory;
}
Also used : DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) AgentInformation(com.navercorp.pinpoint.profiler.AgentInformation)

Aggregations

DefaultPinpointClientFactory (com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory)13 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)11 AgentInformation (com.navercorp.pinpoint.profiler.AgentInformation)2 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)1 ClusterOption (com.navercorp.pinpoint.rpc.cluster.ClusterOption)1 PinpointServerAcceptor (com.navercorp.pinpoint.rpc.server.PinpointServerAcceptor)1 HashMap (java.util.HashMap)1 Logger (org.apache.logging.log4j.Logger)1