@@ -41,6 +41,22 @@ String get_host_from_future(CassFuture* future) {
4141 return response_future->address ().hostname_or_address ();
4242}
4343
44+ StringVec get_attempted_hosts_from_future (CassFuture* future) {
45+ if (future->type () != Future::FUTURE_TYPE_RESPONSE) {
46+ return StringVec ();
47+ }
48+ StringVec attempted_hosts;
49+ ResponseFuture* response_future = static_cast <ResponseFuture*>(future->from ());
50+
51+ AddressVec attempted_addresses = response_future->attempted_addresses ();
52+ for (AddressVec::iterator it = attempted_addresses.begin (); it != attempted_addresses.end ();
53+ ++it) {
54+ attempted_hosts.push_back (it->to_string ());
55+ }
56+ std::sort (attempted_hosts.begin (), attempted_hosts.end ());
57+ return attempted_hosts;
58+ }
59+
4460unsigned get_connect_timeout_from_cluster (CassCluster* cluster) {
4561 return cluster->config ().connect_timeout_ms ();
4662}
@@ -94,4 +110,15 @@ const CassRetryPolicy* get_retry_policy(const CassStatement* statement) {
94110 return CassRetryPolicy::to (statement->from ()->retry_policy ().get ());
95111}
96112
113+ String get_server_name (CassFuture* future) {
114+ if (future->type () != Future::FUTURE_TYPE_RESPONSE) {
115+ return " " ;
116+ }
117+ return static_cast <ResponseFuture*>(future->from ())->address ().server_name ();
118+ }
119+
120+ void set_record_attempted_hosts (CassStatement* statement, bool enable) {
121+ static_cast <Statement*>(statement->from ())->set_record_attempted_addresses (enable);
122+ }
123+
97124}}} // namespace datastax::internal::testing
0 commit comments