@@ -47,44 +47,44 @@ String get_host_from_future(CassFuture* future) {
4747}
4848
4949StringVec get_attempted_hosts_from_future (CassFuture* future) {
50- // Original implementation commented out for reference.
51- /*
52- if (future->type() != Future::FUTURE_TYPE_RESPONSE) {
53- return StringVec();
54- }
50+ // Original implementation commented out for reference.
51+ /*
52+ if (future->type() != Future::FUTURE_TYPE_RESPONSE) {
53+ return StringVec();
54+ }
5555
56- StringVec attempted_hosts;
57- ResponseFuture* response_future = static_cast<ResponseFuture*>(future->from());
56+ StringVec attempted_hosts;
57+ ResponseFuture* response_future = static_cast<ResponseFuture*>(future->from());
5858
59- AddressVec attempted_addresses = response_future->attempted_addresses();
60- for (const auto& address : attempted_addresses) {
61- attempted_hosts.push_back(address.to_string());
62- }
63- std::sort(attempted_hosts.begin(), attempted_hosts.end());
64- return attempted_hosts;
65- */
66-
67- StringVec attempted_hosts;
68-
69- char * const concatenated_attempted_addresses = testing_future_get_attempted_hosts (future);
70-
71- std::string concatenated_addresses = concatenated_attempted_addresses;
72- std::stringstream stream{concatenated_addresses};
73- while (true ) {
74- String address;
75- if (std::getline (stream, address, ' \n ' )) {
76- if (!address.empty ()) {
77- attempted_hosts.push_back (address);
78- }
79- } else {
80- break ; // No more addresses to read.
81- }
59+ AddressVec attempted_addresses = response_future->attempted_addresses();
60+ for (const auto& address : attempted_addresses) {
61+ attempted_hosts.push_back(address.to_string());
62+ }
63+ std::sort(attempted_hosts.begin(), attempted_hosts.end());
64+ return attempted_hosts;
65+ */
66+
67+ StringVec attempted_hosts;
68+
69+ char * const concatenated_attempted_addresses = testing_future_get_attempted_hosts (future);
70+
71+ std::string concatenated_addresses = concatenated_attempted_addresses;
72+ std::stringstream stream{ concatenated_addresses };
73+ while (true ) {
74+ String address;
75+ if (std::getline (stream, address, ' \n ' )) {
76+ if (!address.empty ()) {
77+ attempted_hosts.push_back (address);
78+ }
79+ } else {
80+ break ; // No more addresses to read.
8281 }
83- std::sort (attempted_hosts.begin (), attempted_hosts.end ());
82+ }
83+ std::sort (attempted_hosts.begin (), attempted_hosts.end ());
8484
85- testing_free_cstring (concatenated_attempted_addresses);
85+ testing_free_cstring (concatenated_attempted_addresses);
8686
87- return attempted_hosts;
87+ return attempted_hosts;
8888}
8989
9090unsigned get_connect_timeout_from_cluster (CassCluster* cluster) {
@@ -143,7 +143,7 @@ String get_server_name(CassFuture* future) {
143143}
144144
145145void set_record_attempted_hosts (CassStatement* statement, bool enable) {
146- testing_statement_set_recording_history_listener (statement, (cass_bool_t ) enable);
146+ testing_statement_set_recording_history_listener (statement, (cass_bool_t )enable);
147147}
148148
149149void set_sleeping_history_listener_on_statement (CassStatement* statement, uint64_t sleep_time_ms) {
@@ -154,8 +154,6 @@ void set_sleeping_history_listener_on_batch(CassBatch* batch, uint64_t sleep_tim
154154 testing_batch_set_sleeping_history_listener (batch, sleep_time_ms);
155155}
156156
157- CassRetryPolicy* retry_policy_ignoring_new () {
158- return testing_retry_policy_ignoring_new ();
159- }
157+ CassRetryPolicy* retry_policy_ignoring_new () { return testing_retry_policy_ignoring_new (); }
160158
161159}}} // namespace datastax::internal::testing
0 commit comments