Skip to content

Commit

Permalink
Add clarifying comments.
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Nov 18, 2024
1 parent caefd49 commit ec3386a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sqlodbc/opensearch_communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,18 @@ bool OpenSearchCommunication::EstablishConnection() {
InitializeConnection();
}

// Set whether the connection is to OpenSearch serverless cluster.
// This can be specified explicitly via a configuration option, or
// determined by parsing the server URL.
SetIsServerless();

// Set the SQL endpoint to connect to. If this is a serverless connection,
// the SQL endpoint can be determined directly; if not, the endpoint is
// determined by sending a request to OpenSearch, which may result in an
// error.
SetSqlEndpoint();

if (sql_endpoint == SQL_ENDPOINT_ERROR) {
if (is_serverless && (sql_endpoint == SQL_ENDPOINT_ERROR)) {
LogMsg(OPENSEARCH_ERROR, m_error_message.c_str());
return false;
}
Expand Down

0 comments on commit ec3386a

Please sign in to comment.