@@ -68,32 +68,57 @@ std::vector<TEndPoint> StaticNodesSupplier::getEndPointList() {
6868StaticNodesSupplier::~StaticNodesSupplier () = default ;
6969
7070std::shared_ptr<NodesSupplier> NodesSupplier::create (
71- std::vector<TEndPoint> endpoints,
72- std::string userName, std::string password, std::string zoneId,
73- int32_t thriftDefaultBufferSize, int32_t thriftMaxFrameSize,
74- int32_t connectionTimeoutInMs, bool useSSL, bool enableRPCCompression,
75- std::string version, std::chrono::milliseconds refreshInterval,
71+ const std::vector<TEndPoint>& endpoints,
72+ const std::string& userName,
73+ const std::string& password,
74+ bool useSSL,
75+ const std::string& trustCertFilePath,
76+ const std::string& zoneId,
77+ int32_t thriftDefaultBufferSize,
78+ int32_t thriftMaxFrameSize,
79+ int32_t connectionTimeoutInMs,
80+ bool enableRPCCompression,
81+ const std::string& version,
82+ std::chrono::milliseconds refreshInterval,
7683 NodeSelectionPolicy policy) {
7784 if (endpoints.empty ()) {
7885 return nullptr ;
7986 }
8087 auto supplier = std::make_shared<NodesSupplier>(
81- userName, password, zoneId, thriftDefaultBufferSize,
82- thriftMaxFrameSize, connectionTimeoutInMs, useSSL,
83- enableRPCCompression, version, std::move (endpoints), std::move (policy)
88+ userName, password, useSSL, trustCertFilePath, zoneId,
89+ thriftDefaultBufferSize, thriftMaxFrameSize, connectionTimeoutInMs,
90+ enableRPCCompression,
91+ version, endpoints, policy
8492 );
8593 supplier->startBackgroundRefresh (refreshInterval);
8694 return supplier;
8795}
8896
8997NodesSupplier::NodesSupplier (
90- std::string userName, std::string password, const std::string& zoneId,
91- int32_t thriftDefaultBufferSize, int32_t thriftMaxFrameSize,
92- int32_t connectionTimeoutInMs, bool useSSL, bool enableRPCCompression,
93- std::string version, std::vector<TEndPoint> endpoints, NodeSelectionPolicy policy) : userName_(std::move(userName)), password_(std::move(password)), zoneId_(zoneId),
94- thriftDefaultBufferSize_(thriftDefaultBufferSize), thriftMaxFrameSize_(thriftMaxFrameSize),
95- connectionTimeoutInMs_(connectionTimeoutInMs), useSSL_(useSSL), enableRPCCompression_(enableRPCCompression), version(version), endpoints_(std::move(endpoints)),
96- selectionPolicy_(std::move(policy)) {
98+ const std::string& userName,
99+ const std::string& password,
100+ bool useSSL,
101+ const std::string& trustCertFilePath,
102+ const std::string& zoneId,
103+ int32_t thriftDefaultBufferSize,
104+ int32_t thriftMaxFrameSize,
105+ int32_t connectionTimeoutInMs,
106+ bool enableRPCCompression,
107+ const std::string& version,
108+ const std::vector<TEndPoint>& endpoints,
109+ NodeSelectionPolicy policy)
110+ : userName_(userName)
111+ , password_(password)
112+ , zoneId_(zoneId)
113+ , thriftDefaultBufferSize_(thriftDefaultBufferSize)
114+ , thriftMaxFrameSize_(thriftMaxFrameSize)
115+ , connectionTimeoutInMs_(connectionTimeoutInMs)
116+ , useSSL_(useSSL)
117+ , trustCertFilePath_(trustCertFilePath)
118+ , enableRPCCompression_(enableRPCCompression)
119+ , version_(version)
120+ , endpoints_(endpoints)
121+ , selectionPolicy_(policy) {
97122 deduplicateEndpoints ();
98123}
99124
@@ -157,7 +182,7 @@ std::vector<TEndPoint> NodesSupplier::fetchLatestEndpoints() {
157182 try {
158183 if (client_ == nullptr ) {
159184 client_ = std::make_shared<ThriftConnection>(endpoint);
160- client_->init (userName_, password_, enableRPCCompression_, zoneId_, version );
185+ client_->init (userName_, password_, enableRPCCompression_, useSSL_, trustCertFilePath_, zoneId_, version_ );
161186 }
162187
163188 auto sessionDataSet = client_->executeQueryStatement (SHOW_DATA_NODES_COMMAND);
0 commit comments