Skip to content

Commit

Permalink
Update CppCassandraDriverTest to use only cassandra.h
Browse files Browse the repository at this point in the history
Summary:
Currently CppCassandraDriverTest uses internal .hpp files of the driver.
That is wrong, and whole exported interface is declared in cassandra.h.

This diff fixes such dependency issue.

Test Plan: Jenkins

Reviewers: oleg, mikhail

Reviewed By: mikhail

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7553
  • Loading branch information
spolitov committed Nov 14, 2019
1 parent a89bafa commit a1572d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
27 changes: 6 additions & 21 deletions src/yb/integration-tests/cassandra_cpp_driver-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@

#include <tuple>

// Include driver internal headers first.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"

#include "partition_aware_policy.hpp"
#include "statement.hpp"

#pragma GCC diagnostic pop
// Undefine conflicting macros.
#undef HAVE_LONG_LONG
#undef DECLARE_POD
#undef PROPAGATE_POD_FROM_TEMPLATE_ARGUMENT
#undef ENFORCE_POD

#include "yb/gutil/strings/join.h"
#include "yb/gutil/strings/strip.h"
#include "yb/gutil/strings/substitute.h"
Expand Down Expand Up @@ -273,15 +259,15 @@ class CassandraStatement {

void Bind(size_t index, const cass_json_t& v);

const cass::Request* request() {
return cass_statement_->from();
CassStatement* get() const {
return cass_statement_.get();
}

private:
friend class CassandraBatch;
friend class CassandraSession;

CassStatementPtr cass_statement_ = nullptr;
CassStatementPtr cass_statement_;
};

typedef std::unique_ptr<CassBatch, FuncDeleter<CassBatch, &cass_batch_free>> CassBatchPtr;
Expand Down Expand Up @@ -1144,11 +1130,10 @@ void TestTokenForTypes(
table.BindInsert(&statement, input);

int64_t token = 0;
string full_table_name;
bool token_available = cass::PartitionAwarePolicy::get_yb_hash_code(
statement.request(), &token, &full_table_name);
bool token_available = cass_partition_aware_policy_get_yb_hash_code(
statement.get(), &token);
LOG(INFO) << "Got token: " << (token_available ? "OK" : "ERROR") << " token=" << token
<< " (0x" << std::hex << token << ")" << " table=" << full_table_name;
<< " (0x" << std::hex << token << ")";
ASSERT_TRUE(token_available);

if (exp_token > 0) {
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/build_definitions/cassandra_cpp_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class CassandraCppDriverDependency(Dependency):
def __init__(self):
super(CassandraCppDriverDependency, self).__init__(
'cassandra-cpp-driver', '2.9.0-yb-4',
'cassandra-cpp-driver', '2.9.0-yb-6',
'https://github.com/YugaByte/cassandra-cpp-driver/archive/{0}.tar.gz',
BUILD_GROUP_INSTRUMENTED)
self.copy_sources = False
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/thirdparty_src_checksums.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
a26d338c9024eeedb68e485db0b3a25a5fa00df2c23b9453f77e712c588d3079 bitshuffle-55f9b4c.tar.gz
8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 boost-1.69.0.tar.bz2
8f8299b59caaead1b83bda13c8f0feec652daea22d2247ff5f05cde5266c9901 cassandra-cpp-driver-2.9.0-yb-4.tar.gz
46857c147a6327411952d34a15552cc7b73bb19ccfd6bc564e119be9af6a69d1 cassandra-cpp-driver-2.9.0-yb-6.tar.gz
a45b62dde5d7d5fdcdfa876b0af92f164d434b06e9e89b5d0b1cbc65dfe3f418 cfe-7.0.1.tar.xz
4c93c7d2bb07923a8b272da3ef7914438080aeb693725f4fc5c19cd0e2613bed clang-tools-extra-7.0.1.tar.xz
782edfc119ee172f169c91dd79f2c964fb6b248bd9b73523149030ed505bbe18 compiler-rt-7.0.1.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/version_for_jenkins_linux.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019-10-31T20_23_08
2019-11-13T04_01_33
2 changes: 1 addition & 1 deletion thirdparty/version_for_jenkins_mac.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019-11-01T05_12_28
2019-11-12T20_03_07

0 comments on commit a1572d1

Please sign in to comment.