Created
October 11, 2016 22:18
-
-
Save mpenick/65e597217a7f26aea0486b70946222d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "statement.hpp" | |
| #include "request_handler.hpp" | |
| // ... | |
| BOOST_AUTO_TEST_CASE(spec_ex) | |
| { | |
| test_utils::CassClusterPtr cluster(cass_cluster_new()); | |
| if (ccm->create_cluster(3)) { | |
| ccm->start_cluster(); | |
| } | |
| cass_cluster_set_constant_speculative_execution_policy(cluster.get(), 0, 3); | |
| test_utils::initialize_contact_points(cluster.get(), ccm->get_ip_prefix(), 1); | |
| test_utils::CassSessionPtr session(test_utils::create_session(cluster.get())); | |
| test_utils::CassStatementPtr statement(cass_statement_new("SELECT * FROM system.peers", 0)); | |
| cass_statement_set_is_idempotent(statement.get(), cass_true); | |
| static_cast<cass::Statement*>(statement.get())->set_record_attempted_addresses(true); | |
| test_utils::CassFuturePtr future(cass_session_execute(session.get(), statement.get())); | |
| cass::AddressVec addresses = | |
| static_cast<cass::ResponseFuture*>( | |
| static_cast<cass::Future*>(future.get()))->attempted_addresses(); | |
| for (auto& address : addresses) { | |
| printf("%s\n", address.to_string().c_str()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment