in iotdb-collector/collector-core/src/main/java/org/apache/iotdb/collector/plugin/builtin/sink/client/IoTDBSyncClientManager.java [60:109]
protected IoTDBSyncClientManager(
List<TEndPoint> endPoints,
boolean useSSL,
String trustStorePath,
String trustStorePwd,
/* The following parameters are used locally. */
boolean useLeaderCache,
String loadBalanceStrategy,
/* The following parameters are used to handshake with the receiver. */
String username,
String password,
boolean shouldReceiverConvertOnTypeMismatch,
String loadTsFileStrategy,
boolean validateTsFile,
boolean shouldMarkAsPipeRequest) {
super(
endPoints,
useLeaderCache,
username,
password,
shouldReceiverConvertOnTypeMismatch,
loadTsFileStrategy,
validateTsFile,
shouldMarkAsPipeRequest);
this.useSSL = useSSL;
this.trustStorePath = trustStorePath;
this.trustStorePwd = trustStorePwd;
for (final TEndPoint endPoint : endPoints) {
endPoint2ClientAndStatus.put(endPoint, new Pair<>(null, false));
}
switch (loadBalanceStrategy) {
case CONNECTOR_LOAD_BALANCE_ROUND_ROBIN_STRATEGY:
loadBalancer = new RoundRobinLoadBalancer();
break;
case CONNECTOR_LOAD_BALANCE_RANDOM_STRATEGY:
loadBalancer = new RandomLoadBalancer();
break;
case CONNECTOR_LOAD_BALANCE_PRIORITY_STRATEGY:
loadBalancer = new PriorityLoadBalancer();
break;
default:
LOGGER.warn(
"Unknown load balance strategy: {}, use round-robin strategy instead.",
loadBalanceStrategy);
loadBalancer = new RoundRobinLoadBalancer();
}
}