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));
}
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;
}
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;
}
Aggregations