Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2.4.3
===========
August 22, 2016

Features
--------
* Contact points are now randomized by default (CPP-193)
* Token-aware routing can be used without enabling schema metadata (CPP-387)
* Multiple IP addresses can be resolved from a single domain (CPP-364)

Other
--------
* Fixed issue that would cause quadradic ring processing with invalid
replilcation factors (CPP-298)
* Fixed issue where schema change handler could hang if an error is returned by
Cassandra (CPP-381)
* Fixed crash caused by connecting seperate sessions in multiple threads
(CPP-385)
* Fixed issue where the control connection could timeout as a result of schema
or token map processing (CPP-388)
* Greatly improved the performance of building the token map for token aware
routing (CPP-389)
* Fixed issue where heartbeats were restarted on unresponseive connections and
prevented the connection from being terminated (CPP-392)

2.4.2
===========
June 24, 2016
Expand Down
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Cassandra's native protocol and Cassandra Query Language v3.
- [Blacklist], [whitelist DC], and [blacklist DC] load balancing policies
- [Custom] authenticators
- [Reverse DNS] with SSL peer identity verification support
- Randomized contact points

More information about features included in 2.3 can be found in this [blog
post](http://www.datastax.com/dev/blog/datastax-c-driver-2-3-ga-released).
Expand Down Expand Up @@ -93,14 +94,18 @@ There are several examples provided here: [examples](https://github.com/datastax
#include <cassandra.h>
#include <stdio.h>

int main() {
int main(int argc, char* argv[]) {
/* Setup and connect to cluster */
CassFuture* connect_future = NULL;
CassCluster* cluster = cass_cluster_new();
CassSession* session = cass_session_new();
char* hosts = "127.0.0.1";
if (argc > 1) {
hosts = argv[1];
}

/* Add contact points */
cass_cluster_set_contact_points(cluster, "127.0.0.1,127.0.0.2,127.0.0.3");
cass_cluster_set_contact_points(cluster, hosts);

/* Provide the cluster object as configuration to connect the session */
connect_future = cass_session_connect(session, cluster);
Expand All @@ -109,37 +114,32 @@ int main() {
CassFuture* close_future = NULL;

/* Build statement and execute query */
CassStatement* statement
= cass_statement_new("SELECT keyspace_name "
"FROM system.schema_keyspaces", 0);
const char* query = "SELECT release_version FROM system.local";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);

if(cass_future_error_code(result_future) == CASS_OK) {
/* Retrieve result set and iterate over the rows */
if (cass_future_error_code(result_future) == CASS_OK) {
/* Retrieve result set and get the first row */
const CassResult* result = cass_future_get_result(result_future);
CassIterator* rows = cass_iterator_from_result(result);
const CassRow* row = cass_result_first_row(result);

while(cass_iterator_next(rows)) {
const CassRow* row = cass_iterator_get_row(rows);
const CassValue* value = cass_row_get_column_by_name(row, "keyspace_name");
if (row) {
const CassValue* value = cass_row_get_column_by_name(row, "release_version");

const char* keyspace;
size_t keyspace_length;
cass_value_get_string(value, &keyspace, &keyspace_length);
printf("keyspace_name: '%.*s'\n",
(int)keyspace_length, keyspace);
const char* release_version;
size_t release_version_length;
cass_value_get_string(value, &release_version, &release_version_length);
printf("release_version: '%.*s'\n", (int)release_version_length, release_version);
}

cass_result_free(result);
cass_iterator_free(rows);
} else {
/* Handle error */
const char* message;
size_t message_length;
cass_future_error_message(result_future, &message, &message_length);
fprintf(stderr, "Unable to run query: '%.*s'\n",
(int)message_length, message);
fprintf(stderr, "Unable to run query: '%.*s'\n", (int)message_length, message);
}

cass_statement_free(statement);
Expand All @@ -154,8 +154,7 @@ int main() {
const char* message;
size_t message_length;
cass_future_error_message(connect_future, &message, &message_length);
fprintf(stderr, "Unable to connect: '%.*s'\n",
(int)message_length, message);
fprintf(stderr, "Unable to connect: '%.*s'\n", (int)message_length, message);
}

cass_future_free(connect_future);
Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/CppDriver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.6.4)
# Includes
#-----------
include(FindPackageHandleStandardArgs)
include(CheckCXXSymbolExists)
include(CheckSymbolExists)

#-----------
# Policies
Expand Down Expand Up @@ -497,8 +497,8 @@ macro(CassFindSourceFiles)
endmacro()

macro(CassConfigure)
check_cxx_symbol_exists(SO_NOSIGPIPE "sys/socket.h;sys/types.h" HAVE_NOSIGPIPE)
check_cxx_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
check_symbol_exists(SO_NOSIGPIPE "sys/socket.h;sys/types.h" HAVE_NOSIGPIPE)
check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT)
if (NOT WIN32 AND NOT HAVE_NOSIGPIPE AND NOT HAVE_SIGTIMEDWAIT)
message(WARNING "Unable to handle SIGPIPE on your platform")
endif()
Expand Down
23 changes: 10 additions & 13 deletions examples/simple/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,27 @@ int main(int argc, char* argv[]) {
CassFuture* close_future = NULL;

/* Build statement and execute query */
const char* query = "SELECT keyspace_name "
"FROM system.schema_keyspaces;";
const char* query = "SELECT release_version FROM system.local";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);

if (cass_future_error_code(result_future) == CASS_OK) {
/* Retrieve result set and iterate over the rows */
/* Retrieve result set and get the first row */
const CassResult* result = cass_future_get_result(result_future);
CassIterator* rows = cass_iterator_from_result(result);
const CassRow* row = cass_result_first_row(result);

while (cass_iterator_next(rows)) {
const CassRow* row = cass_iterator_get_row(rows);
const CassValue* value = cass_row_get_column_by_name(row, "keyspace_name");
if (row) {
const CassValue* value = cass_row_get_column_by_name(row, "release_version");

const char* keyspace_name;
size_t keyspace_name_length;
cass_value_get_string(value, &keyspace_name, &keyspace_name_length);
printf("keyspace_name: '%.*s'\n", (int)keyspace_name_length,
keyspace_name);
const char* release_version;
size_t release_version_length;
cass_value_get_string(value, &release_version, &release_version_length);
printf("release_version: '%.*s'\n", (int)release_version_length,
release_version);
}

cass_result_free(result);
cass_iterator_free(rows);
} else {
/* Handle error */
const char* message;
Expand Down
23 changes: 10 additions & 13 deletions examples/ssl/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,30 +91,27 @@ int main(int argc, char* argv[]) {
CassFuture* close_future = NULL;

/* Build statement and execute query */
const char* query = "SELECT keyspace_name "
"FROM system.schema_keyspaces;";
const char* query = "SELECT release_version FROM system.local";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);

if (cass_future_error_code(result_future) == CASS_OK) {
/* Retrieve result set and iterator over the rows */
/* Retrieve result set and get the first row */
const CassResult* result = cass_future_get_result(result_future);
CassIterator* rows = cass_iterator_from_result(result);
const CassRow* row = cass_result_first_row(result);

while (cass_iterator_next(rows)) {
const CassRow* row = cass_iterator_get_row(rows);
const CassValue* value = cass_row_get_column_by_name(row, "keyspace_name");
if (row) {
const CassValue* value = cass_row_get_column_by_name(row, "release_version");

const char* keyspace_name;
size_t keyspace_name_length;
cass_value_get_string(value, &keyspace_name, &keyspace_name_length);
printf("keyspace_name: '%.*s'\n", (int)keyspace_name_length,
keyspace_name);
const char* release_version;
size_t release_version_length;
cass_value_get_string(value, &release_version, &release_version_length);
printf("release_version: '%.*s'\n", (int)release_version_length,
release_version);
}

cass_result_free(result);
cass_iterator_free(rows);
} else {
/* Handle error */
const char* message;
Expand Down
2 changes: 1 addition & 1 deletion include/cassandra.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

#define CASS_VERSION_MAJOR 2
#define CASS_VERSION_MINOR 4
#define CASS_VERSION_PATCH 2
#define CASS_VERSION_PATCH 3
#define CASS_VERSION_SUFFIX ""

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion packaging/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ release=1
dist=$(lsb_release -s -c)
base="cassandra-cpp-driver-$version"
archive="$base.tar.gz"
files="CMakeLists.txt cmake cmake_uninstall.cmake.in include src"
files="CMakeLists.txt cmake cmake_uninstall.cmake.in cassconfig.hpp.in include src"

echo "Building version $version"

Expand Down
2 changes: 1 addition & 1 deletion packaging/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fi
version=$(header_version "../include/cassandra.h")
base="cassandra-cpp-driver-$version"
archive="$base.tar.gz"
files="CMakeLists.txt cmake cmake_uninstall.cmake.in include src README.md LICENSE.txt"
files="CMakeLists.txt cmake cmake_uninstall.cmake.in cassconfig.hpp.in include src README.md LICENSE.txt"

echo "Building version $version"

Expand Down
1 change: 0 additions & 1 deletion topics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ Here are some features that are missing from the C/C++ driver, but are included
- Query tracing
- Event registration and notification
- Callback interfaces for load balancing, authentication, reconnection and retry
- Generic SASL authentication interface

[`cass_int32_t`]: http://datastax.github.io/cpp-driver/api/cassandra.h/#cass-int32-t
[`cass_result_first_row()`]: http://datastax.github.io/cpp-driver/api/CassResult/#cass-result-first-row
3 changes: 0 additions & 3 deletions topics/basics/schema_metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ overhead. This can be useful to improve the startup performance of the
short-lived sessions or an environment where up-to-date schema metadata is
unnecessary.

**Important**: This also disables token-aware routing because it depends on
schema metadata.

```c
/* Disable schema metdata */
cass_cluster_set_use_schema(cluster, cass_false);
Expand Down
2 changes: 1 addition & 1 deletion topics/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ in conjunction with other load balancing and routing policies.
cass_cluster_set_token_aware_routing(cluster, cass_true);

/* Disable token-aware routing */
cass_cluster_set_token_aware_routing(cluster, cass_true);
cass_cluster_set_token_aware_routing(cluster, cass_false);
```

### Latency-aware Routing
Expand Down