From 9465ae86de437b80625ffbf8db39570ef9d811bb Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Wed, 16 Jun 2010 22:51:33 -0400 Subject: [PATCH 01/22] * Replace getSliceNames and getSliceRange with getColumns and getSuperColumns * Better examples --- examples/simple.cc | 159 +++++++++++++++++++++++++++++++++------ libcassandra/keyspace.cc | 140 ++++++++++++++++++++++++++++------ libcassandra/keyspace.h | 82 ++++++++++++++++++-- 3 files changed, 330 insertions(+), 51 deletions(-) diff --git a/examples/simple.cc b/examples/simple.cc index 1c99165..14af062 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -16,45 +16,158 @@ using namespace libcassandra; static string host("127.0.0.1"); static int port= 9160; -int main() -{ - CassandraFactory factory(host, port); - tr1::shared_ptr client(factory.create()); +void print_cluster_info(tr1::shared_ptr client) { string clus_name= client->getClusterName(); - cout << "cluster name: " << clus_name << endl; + cout << "\tCluster name: " << clus_name << endl; set key_out= client->getKeyspaces(); for (set::iterator it = key_out.begin(); it != key_out.end(); ++it) { - cout << "keyspace: " << *it << endl; + cout << "\tKeyspace: " << *it << endl; } map tokens= client->getTokenMap(false); for (map::iterator it= tokens.begin(); - it != tokens.end(); - ++it) + it != tokens.end(); + ++it) { - cout << it->first << " : " << it->second << endl; + cout << "\t" << it->first << " : " << it->second << endl; } - Keyspace *key_space= client->getKeyspace("drizzle"); - /* insert data */ - try - { - key_space->insertColumn("sarah", "Data", "third", "this is data being inserted!"); - /* retrieve that data */ - string res= key_space->getColumnValue("sarah", "Data", "third"); - cout << "Value in column retrieved is: " << res << endl; +} + +void single_insert_get(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + + key_space->insertColumn("bob", "Standard1", "age", "20"); + string res= key_space->getColumnValue("bob", "Standard1", "age"); + cout << "\tValue in column retrieved is: " << res << endl; + +} + +void getcolumns_bykeys(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + + key_space->insertColumn("bob", "Standard1", "age", "20"); + key_space->insertColumn("bob", "Standard1", "eyes", "blue"); + + vector keys; + keys.push_back("age"); + keys.push_back("eyes"); + vector cols= key_space->getColumns("bob", "Standard1", keys); + + for (vector::iterator it = cols.begin(); it != cols.end(); ++it) { + cout << "\tGot column " << it->name << " = " << it->value << endl; } - catch (org::apache::cassandra::InvalidRequestException &ire) - { - cout << ire.why << endl; - delete key_space; - return 1; + +} + +void getsupercolumns_bykeys(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + + key_space->insertColumn("bob", "Super1", "friend1", "name", "tim"); + key_space->insertColumn("bob", "Super1", "friend1", "age", "20"); + + key_space->insertColumn("bob", "Super1", "friend2", "name", "mac"); + key_space->insertColumn("bob", "Super1", "friend2", "age", "30"); + + key_space->insertColumn("bob", "Super1", "friend3", "name", "bud"); + key_space->insertColumn("bob", "Super1", "friend3", "age", "40"); + + vector keys; + keys.push_back("friend1"); + keys.push_back("friend2"); + vector scols= key_space->getSuperColumns("bob", "Super1", keys); + + for (vector::iterator it = scols.begin(); it != scols.end(); ++it) { + cout << "\tGot super column " << it->name << endl; + for (vector::iterator it2 = it->columns.begin(); it2 != it->columns.end(); ++it2) { + cout << "\t\tChild column " << it2->name << " = " << it2->value << endl; + } } - delete key_space; +} + +void getsupercolumns_byrange(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + + key_space->insertColumn("bob", "Super1", "friend1", "name", "tim"); + key_space->insertColumn("bob", "Super1", "friend1", "age", "20"); + + key_space->insertColumn("bob", "Super1", "friend2", "name", "mac"); + key_space->insertColumn("bob", "Super1", "friend2", "age", "30"); + + key_space->insertColumn("bob", "Super1", "friend3", "name", "bud"); + key_space->insertColumn("bob", "Super1", "friend3", "age", "40"); + + org::apache::cassandra::SliceRange range; + range.start.assign("friend2"); + range.finish.assign("friend3"); + vector scols= key_space->getSuperColumns("bob", "Super1", range); + + for (vector::iterator it = scols.begin(); it != scols.end(); ++it) { + cout << "\tGot super column " << it->name << endl; + for (vector::iterator it2 = it->columns.begin(); it2 != it->columns.end(); ++it2) { + cout << "\t\tChild column " << it2->name << " = " << it2->value << endl; + } + } + +} + +void getcolumns_byrange(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + + key_space->insertColumn("bob", "Standard1", "aaa1", "vaaa1"); + key_space->insertColumn("bob", "Standard1", "bbb1", "vbbb1"); + key_space->insertColumn("bob", "Standard1", "bbb2", "vbbb2"); + key_space->insertColumn("bob", "Standard1", "bbb3", "vbbb3"); + key_space->insertColumn("bob", "Standard1", "ccc1", "vccc1"); + + org::apache::cassandra::SliceRange range; + range.start.assign("bbb1"); + range.finish.assign("bbb3"); + vector cols= key_space->getColumns("bob", "Standard1", range); + + for (vector::iterator it = cols.begin(); it != cols.end(); ++it) { + cout << "\tGot column " << it->name << " = " << it->value << endl; + } + +} + +int main() { + + CassandraFactory factory(host, port); + tr1::shared_ptr client(factory.create()); + + cout << "Cluster Info:" << endl; + print_cluster_info(client); + cout << endl; + + cout << "Single insert and get:" << endl; + single_insert_get(client); + cout << endl; + + cout << "GetColumns by keys:" << endl; + getcolumns_bykeys(client); + cout << endl; + + cout << "GetColumns by range:" << endl; + getcolumns_byrange(client); + cout << endl; + + cout << "GetSuperColumns by keys:" << endl; + getsupercolumns_bykeys(client); + cout << endl; + + cout << "GetSuperColumns by range:" << endl; + getsupercolumns_byrange(client); + cout << endl; return 0; } diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index 8cae595..95dbf42 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -153,6 +153,89 @@ Column Keyspace::getColumn(const string &key, return getColumn(key, column_family, "", column_name); } +vector Keyspace::getColumns( + const string &key, + const string &column_family, + const string &super_column_name, + const vector column_names) +{ + + ColumnParent col_parent; + SlicePredicate pred; + vector ret_cosc; + vector result; + + col_parent.column_family.assign(column_family); + if (! super_column_name.empty()) + { + col_parent.super_column.assign(super_column_name); + col_parent.__isset.super_column= true; + } + + pred.column_names = column_names; + pred.__isset.column_names= true; + + client->getCassandra()->get_slice(ret_cosc, name, key, col_parent, pred, level); + for (vector::iterator it= ret_cosc.begin(); + it != ret_cosc.end(); + ++it) + { + if (! (*it).column.name.empty()) + { + result.push_back((*it).column); + } + } + return result; +} + +vector Keyspace::getColumns( + const string &key, + const string &column_family, + const vector column_names) +{ + return(getColumns(key, column_family, "", column_names)); +} + +vector Keyspace::getColumns(const string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range) +{ + + ColumnParent col_parent; + SlicePredicate pred; + vector ret_cosc; + vector result; + + col_parent.column_family.assign(column_family); + if (! super_column_name.empty()) + { + col_parent.super_column.assign(super_column_name); + col_parent.__isset.super_column= true; + } + + pred.slice_range = range; + pred.__isset.slice_range= true; + + client->getCassandra()->get_slice(ret_cosc, name, key, col_parent, pred, level); + for (vector::iterator it= ret_cosc.begin(); + it != ret_cosc.end(); + ++it) + { + if (! (*it).column.name.empty()) + { + result.push_back((*it).column); + } + } + return result; +} + +vector Keyspace::getColumns(const string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range) +{ + return(getColumns(key, column_family, "", range)); +} string Keyspace::getColumnValue(const string &key, const string &column_family, @@ -167,7 +250,7 @@ string Keyspace::getColumnValue(const string &key, const string &column_family, const string &column_name) { - return getColumn(key, column_family, column_name).value; + return getColumn(key, column_family, column_name).value; } @@ -191,51 +274,64 @@ SuperColumn Keyspace::getSuperColumn(const string &key, return cosc.super_column; } - -vector Keyspace::getSliceNames(const string &key, - const ColumnParent &col_parent, - SlicePredicate &pred) +vector Keyspace::getSuperColumns( + const string &key, + const string &column_family, + const vector super_column_names) { + + ColumnParent col_parent; + SlicePredicate pred; vector ret_cosc; - vector result; - /* damn you thrift! */ + vector result; + + col_parent.column_family.assign(column_family); + + pred.column_names = super_column_names; pred.__isset.column_names= true; + client->getCassandra()->get_slice(ret_cosc, name, key, col_parent, pred, level); for (vector::iterator it= ret_cosc.begin(); - it != ret_cosc.end(); - ++it) + it != ret_cosc.end(); + ++it) { - if (! (*it).column.name.empty()) + if (! (*it).super_column.name.empty()) { - result.push_back((*it).column); + result.push_back((*it).super_column); } } return result; } - -vector Keyspace::getSliceRange(const string &key, - const ColumnParent &col_parent, - SlicePredicate &pred) +vector Keyspace::getSuperColumns( + const string &key, + const string &column_family, + const org::apache::cassandra::SliceRange &range) { + + ColumnParent col_parent; + SlicePredicate pred; vector ret_cosc; - vector result; - /* damn you thrift! */ + vector result; + + col_parent.column_family.assign(column_family); + + pred.slice_range = range; pred.__isset.slice_range= true; + client->getCassandra()->get_slice(ret_cosc, name, key, col_parent, pred, level); for (vector::iterator it= ret_cosc.begin(); - it != ret_cosc.end(); - ++it) + it != ret_cosc.end(); + ++it) { - if (! (*it).column.name.empty()) + if (! (*it).super_column.name.empty()) { - result.push_back((*it).column); + result.push_back((*it).super_column); } } return result; } - map > Keyspace::getRangeSlice(const ColumnParent &col_parent, const SlicePredicate &pred, const string &start, diff --git a/libcassandra/keyspace.h b/libcassandra/keyspace.h index 4dccc37..39dbcb0 100644 --- a/libcassandra/keyspace.h +++ b/libcassandra/keyspace.h @@ -122,6 +122,58 @@ class Keyspace const std::string &super_column_name, const std::string &column_name); + /** + * Retrieve multiple columns by names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] super_column_name the super column name (optional) + * @param[in] the list of column names + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const std::vector column_names); + + /** + * Retrieve multiple columns by names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] the list of column names + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::vector column_names); + + /** + * Retrieve multiple columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] super_column_name the super column name (optional) + * @param[in] the range for the query + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range); + + /** + * Retrieve multiple columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] the range for the query + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range); + /** * Retrieve a column * @@ -164,13 +216,31 @@ class Keyspace const std::string &column_family, const std::string &super_column_name); - std::vector getSliceNames(const std::string &key, - const org::apache::cassandra::ColumnParent &col_parent, - org::apache::cassandra::SlicePredicate &pred); + /** + * Retrieve multiple super columns by names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] the list of super column names + * @return A list of found super columns + */ + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const std::vector super_column_names); + /** + * Retrieve multiple super columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] the range for the query + * @return A list of found super columns + */ - std::vector getSliceRange(const std::string &key, - const org::apache::cassandra::ColumnParent &col_parent, - org::apache::cassandra::SlicePredicate &pred); + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range); std::map > getRangeSlice(const org::apache::cassandra::ColumnParent &col_parent, From 72357063117f5a84c39d1f290ef503caac2dc783 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Wed, 16 Jun 2010 22:55:17 -0400 Subject: [PATCH 02/22] Version bump due to API change --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e466e86..4376943 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ AC_CONFIG_AUX_DIR(config) PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, skip-visibility) #shared library versioning -CASSANDRA_LIBRARY_VERSION=1:0:0 +CASSANDRA_LIBRARY_VERSION=2:0:0 # | | | # +------+ | +---+ # | | | From a009b32d99a745dfb99a22ef4dcb2f145dcccacf Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Thu, 17 Jun 2010 11:55:53 -0400 Subject: [PATCH 03/22] * Bugfix Keyspace::remove not handling super_column properly * Add Keyspace::removeColumn variant with no super_column_name in signature * Extend examples/simple.cc with more and better examples --- examples/simple.cc | 37 +++++++++++++++++++++++++++++++++---- libcassandra/keyspace.cc | 9 ++++++++- libcassandra/keyspace.h | 11 +++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/examples/simple.cc b/examples/simple.cc index 14af062..133ce62 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -37,16 +37,41 @@ void print_cluster_info(tr1::shared_ptr client) { } -void single_insert_get(tr1::shared_ptr client) { +void crud_simple(tr1::shared_ptr client) { Keyspace *key_space= client->getKeyspace("Keyspace1"); + string res; key_space->insertColumn("bob", "Standard1", "age", "20"); - string res= key_space->getColumnValue("bob", "Standard1", "age"); + res = key_space->getColumnValue("bob", "Standard1", "age"); cout << "\tValue in column retrieved is: " << res << endl; + key_space->insertColumn("bob", "Standard1", "age", "35"); + res = key_space->getColumnValue("bob", "Standard1", "age"); + cout << "\tValue in column retrieved is: " << res << endl; + + key_space->removeColumn("bob", "Standard1", "age"); + +} + +void crud_super(tr1::shared_ptr client) { + + Keyspace *key_space= client->getKeyspace("Keyspace1"); + string res; + + key_space->insertColumn("bob", "Super1", "attrs", "age", "20"); + res = key_space->getColumnValue("bob", "Super1", "attrs", "age"); + cout << "\tValue in column retrieved is: " << res << endl; + + key_space->insertColumn("bob", "Super1", "attrs", "age", "35"); + res = key_space->getColumnValue("bob", "Super1", "attrs", "age"); + cout << "\tValue in column retrieved is: " << res << endl; + + key_space->removeSuperColumn("bob", "Super1", "attrs"); + } + void getcolumns_bykeys(tr1::shared_ptr client) { Keyspace *key_space= client->getKeyspace("Keyspace1"); @@ -149,8 +174,12 @@ int main() { print_cluster_info(client); cout << endl; - cout << "Single insert and get:" << endl; - single_insert_get(client); + cout << "Single CRUD:" << endl; + crud_simple(client); + cout << endl; + + cout << "SuperColumn CRUD:" << endl; + crud_super(client); cout << endl; cout << "GetColumns by keys:" << endl; diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index 95dbf42..44a989c 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -92,7 +92,7 @@ void Keyspace::remove(const string &key, col_path.column_family.assign(column_family); if (! super_column_name.empty()) { - col_path.column.assign(super_column_name); + col_path.super_column.assign(super_column_name); col_path.__isset.super_column= true; } if (! column_name.empty()) @@ -112,6 +112,13 @@ void Keyspace::removeColumn(const string &key, remove(key, column_family, super_column_name, column_name); } +void Keyspace::removeColumn(const string &key, + const string &column_family, + const string &column_name) +{ + remove(key, column_family, "", column_name); +} + void Keyspace::removeSuperColumn(const string &key, const string &column_family, diff --git a/libcassandra/keyspace.h b/libcassandra/keyspace.h index 39dbcb0..1d8735b 100644 --- a/libcassandra/keyspace.h +++ b/libcassandra/keyspace.h @@ -96,6 +96,17 @@ class Keyspace const std::string &super_column_name, const std::string &column_name); + /** + * Remove a column + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] column_name the column name (optional) + */ + void removeColumn(const std::string &key, + const std::string &column_family, + const std::string &column_name); + /** * Remove a super column and all columns under it From 1d6082342120190939127c820c0ac625835393c8 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Mon, 5 Jul 2010 18:52:55 -0700 Subject: [PATCH 04/22] Eliminate hard-coded include path in M4 macro for Thrift --- configure.ac | 2 +- m4/pandora_have_thrift.m4 | 71 +++++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index e466e86..c82db21 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,7 @@ AC_SEARCH_LIBS(gethostbyname, nsl) AC_CHECK_FUNCS([getline]) -PANDORA_REQUIRE_LIBTHRIFT +PANDORA_REQUIRE_THRIFT AC_LANG_PUSH(C++) PANDORA_REQUIRE_PTHREAD diff --git a/m4/pandora_have_thrift.m4 b/m4/pandora_have_thrift.m4 index bece318..180d051 100644 --- a/m4/pandora_have_thrift.m4 +++ b/m4/pandora_have_thrift.m4 @@ -1,37 +1,44 @@ -dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*- -dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab: -dnl -dnl Copyright (C) 2010 Padraig O'Sullivan -dnl This file is free software; +dnl Copyright (C) 2010 Padraig O'Sullivan +dnl This file is free software; Padraig O'Sullivan dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl - -dnl -------------------------------------------------------------------- -dnl Check for Thrift -dnl -------------------------------------------------------------------- - -AC_DEFUN([_PANDORA_SEARCH_LIBTHRIFT],[ - AC_REQUIRE([PANDORA_HAVE_PTHREAD]) - - AC_LANG_PUSH([C++]) - save_CXXFLAGS="${CXXFLAGS}" - CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}" - AC_LIB_HAVE_LINKFLAGS(thrift,, - [#include ], - [PACKAGE_STRING]) - AM_CXXFLAGS="${AM_CXXFLAGS} -I/usr/local/include/thrift" - CXXFLAGS="${save_CXXFLAGS}" - AC_LANG_POP() + +AC_DEFUN([_PANDORA_SEARCH_THRIFT],[ + AC_REQUIRE([AC_LIB_PREFIX]) + + dnl -------------------------------------------------------------------- + dnl Check for thrift + dnl -------------------------------------------------------------------- + + AC_ARG_ENABLE([thrift], + [AS_HELP_STRING([--disable-thrift], + [Build with thrift support @<:@default=on@:>@])], + [ac_enable_thrift="$enableval"], + [ac_enable_thrift="yes"]) + + AS_IF([test "x$ac_enable_thrift" = "xyes"],[ + AC_LANG_PUSH(C++) + AC_LIB_HAVE_LINKFLAGS(thrift,,[ + #include + ],[ + apache::thrift::TOutput test_output; + ]) + AC_LANG_POP() + ],[ + ac_cv_thrift="no" + ]) + + AM_CONDITIONAL(HAVE_THRIFT, [test "x${ac_cv_thrift}" = "xyes"]) + ]) - -AC_DEFUN([PANDORA_HAVE_LIBTHRIFT],[ - AC_REQUIRE([_PANDORA_SEARCH_LIBTHRIFT]) + +AC_DEFUN([PANDORA_HAVE_THRIFT],[ + AC_REQUIRE([_PANDORA_SEARCH_THRIFT]) ]) - -AC_DEFUN([PANDORA_REQUIRE_LIBTHRIFT],[ - AC_REQUIRE([PANDORA_HAVE_LIBTHRIFT]) - AS_IF([test x$ac_cv_libthrift = xno], - AC_MSG_ERROR([libthrift is required for ${PACKAGE}.])) + +AC_DEFUN([PANDORA_REQUIRE_THRIFT],[ + AC_REQUIRE([PANDORA_HAVE_THRIFT]) + AS_IF([test x$ac_cv_thrift= xno],[ + AC_MSG_ERROR([thrift required for ${PACKAGE}]) + ]) ]) - From 48ce0c1e16560e7d9214206c4780235f150950d6 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Mon, 5 Jul 2010 18:54:43 -0700 Subject: [PATCH 05/22] Trail upstream relocation of thrift headers --- libcassandra/cassandra_factory.cc | 6 +++--- libcassandra/keyspace.cc | 6 +++--- libcassandra/keyspace_factory.cc | 6 +++--- libgenthrift/Cassandra.h | 2 +- libgenthrift/Cassandra_server.skeleton.cpp | 8 ++++---- libgenthrift/cassandra_types.h | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libcassandra/cassandra_factory.cc b/libcassandra/cassandra_factory.cc index b948d44..d314a81 100644 --- a/libcassandra/cassandra_factory.cc +++ b/libcassandra/cassandra_factory.cc @@ -11,9 +11,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index 8cae595..ba20935 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -12,9 +12,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/libcassandra/keyspace_factory.cc b/libcassandra/keyspace_factory.cc index ebee005..865f289 100644 --- a/libcassandra/keyspace_factory.cc +++ b/libcassandra/keyspace_factory.cc @@ -10,9 +10,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/libgenthrift/Cassandra.h b/libgenthrift/Cassandra.h index bcd7a05..6596d4e 100644 --- a/libgenthrift/Cassandra.h +++ b/libgenthrift/Cassandra.h @@ -6,7 +6,7 @@ #ifndef Cassandra_H #define Cassandra_H -#include +#include #include "cassandra_types.h" namespace org { namespace apache { namespace cassandra { diff --git a/libgenthrift/Cassandra_server.skeleton.cpp b/libgenthrift/Cassandra_server.skeleton.cpp index 03e64be..5699091 100644 --- a/libgenthrift/Cassandra_server.skeleton.cpp +++ b/libgenthrift/Cassandra_server.skeleton.cpp @@ -2,10 +2,10 @@ // You should copy it to another filename to avoid overwriting it. #include "Cassandra.h" -#include -#include -#include -#include +#include +#include +#include +#include using namespace ::apache::thrift; using namespace ::apache::thrift::protocol; diff --git a/libgenthrift/cassandra_types.h b/libgenthrift/cassandra_types.h index 0e84217..53f7cae 100644 --- a/libgenthrift/cassandra_types.h +++ b/libgenthrift/cassandra_types.h @@ -6,9 +6,9 @@ #ifndef cassandra_TYPES_H #define cassandra_TYPES_H -#include -#include -#include +#include +#include +#include From a615874ebdfbfe7eebd5dc9506866496d3480723 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Mon, 5 Jul 2010 18:56:03 -0700 Subject: [PATCH 06/22] Add .svn to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 591588f..b51ce87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.svn *.o *.la *.lo From b8a7d5e6b22b7074049036c1891ebf26e5336430 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Tue, 6 Jul 2010 19:57:33 -0700 Subject: [PATCH 07/22] Added Debian packaging --- debian/changelog | 5 +++ debian/compat | 1 + debian/control | 42 ++++++++++++++++++++ debian/copyright | 70 +++++++++++++++++++++++++++++++++ debian/libcassandra-dev.install | 4 ++ debian/libcassandra1.install | 2 + debian/rules | 10 +++++ 7 files changed, 134 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libcassandra-dev.install create mode 100644 debian/libcassandra1.install create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f393ebb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libcassandra (0.1-0ubuntu1) lucid; urgency=low + + * Initial release. + + -- Hannes Schmidt Tue, 06 Jul 2010 14:54:23 -0700 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e912d28 --- /dev/null +++ b/debian/control @@ -0,0 +1,42 @@ +Source: libcassandra +Section: devel +Priority: extra +Build-Depends: debhelper (>= 5), build-essential, mono-gmcs, python-dev, ant, + libmono-dev, erlang-base, ruby1.8-dev, autoconf, python-support, automake, + pkg-config, libtool, libboost-dev, libthrift-dev (>= 0.2.0), cdbs +Maintainer: Hannes Schmidt +Standards-Version: 3.7.3 + +Package: libcassandra1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Apache Cassandra C++ client library + C++ wrapper library for the interface to Cassandra generated by Thrift. This + library is based on the Java client Hector. + . + The Apache Cassandra Project develops a highly scalable second-generation + distributed database, bringing together Dynamo's fully distributed design + and Bigtable's ColumnFamily-based data model. + . + Cassandra was open-sourced by Facebook in 2008, and is now developed by Apache + committers and contributors from many companies. + . + This package contains the runtime libraries needed for C++ client + applications using . + +Package: libcassandra-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, libcassandra0.6 +Description: Apache Cassandra C++ client library (development headers) + A C++ wrapper library for the interface to Cassandra generated by Thrift. This + library is based on the Java client Hector. + . + The Apache Cassandra Project develops a highly scalable second-generation + distributed database, bringing together Dynamo's fully distributed design + and Bigtable's ColumnFamily-based data model. + . + Cassandra was open-sourced by Facebook in 2008, and is now developed by Apache + committers and contributors from many companies. + . + This package contains the runtime libraries needed for C++ client applications. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..95fcc68 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Hannes Schmidt +6/6/2010 + +It was downloaded from: http://github.com/posulliv/libcassandra with minor +patches hosted at http://github.com/eyealike/libcassandra. + +Upstream Author(s): Padraig O'Sullivan + +Copyright: + Copyright (c) 2010, Padraig O'Sullivan + +License: + Software License Agreement (BSD License) + + Copyright (c) 2010, Padraig O'Sullivan + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + * Neither the name of Padraig O'Sullivan nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Packaging: + Copyright (c) 2010, by Hannes Schmidt + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/libcassandra-dev.install b/debian/libcassandra-dev.install new file mode 100644 index 0000000..4379672 --- /dev/null +++ b/debian/libcassandra-dev.install @@ -0,0 +1,4 @@ +usr/lib/*.la +usr/lib/libcassandra.so +usr/lib/libgenthrift.so +usr/include diff --git a/debian/libcassandra1.install b/debian/libcassandra1.install new file mode 100644 index 0000000..1edf86d --- /dev/null +++ b/debian/libcassandra1.install @@ -0,0 +1,2 @@ +usr/lib/libcassandra.so.* +usr/lib/libgenthrift.so.* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..99856c1 --- /dev/null +++ b/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk + +DEB_DH_INSTALL_SOURCEDIR = $(CURDIR)/debian/tmp + +makebuilddir:: + config/autorun.sh + From 41396868e38d3b8ae558b3e2eaba828329647fe4 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Tue, 6 Jul 2010 20:25:50 -0700 Subject: [PATCH 08/22] Added top.h to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b51ce87..75ea4d9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ config.status config.sub config/plugin.ac config/pandora_vc_revinfo +config/top.h Makefile Makefile.in autom4te.cache/ From 98cc2d6789baad43b4522239c421ba05365a452a Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Wed, 7 Jul 2010 11:15:36 -0700 Subject: [PATCH 09/22] Use quotes for intra-project includes (in case libcassandra is in /usr on the build machine) --- examples/get_drizzle_data.cc | 6 +++--- examples/simple.cc | 6 +++--- libcassandra/cassandra.cc | 2 +- libcassandra/cassandra.h | 2 +- libcassandra/cassandra_factory.cc | 2 +- libcassandra/keyspace.cc | 2 +- libcassandra/keyspace.h | 2 +- libcassandra/keyspace_factory.cc | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/get_drizzle_data.cc b/examples/get_drizzle_data.cc index 0597aeb..2ef0431 100644 --- a/examples/get_drizzle_data.cc +++ b/examples/get_drizzle_data.cc @@ -6,9 +6,9 @@ #include #include -#include -#include -#include +#include "../libcassandra/cassandra_factory.h" +#include "../libcassandra/cassandra.h" +#include "../libcassandra/keyspace.h" using namespace std; using namespace libcassandra; diff --git a/examples/simple.cc b/examples/simple.cc index 1c99165..c9ef8f1 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -6,9 +6,9 @@ #include #include -#include -#include -#include +#include "../libcassandra/cassandra_factory.h" +#include "../libcassandra/cassandra.h" +#include "../libcassandra/keyspace.h" using namespace std; using namespace libcassandra; diff --git a/libcassandra/cassandra.cc b/libcassandra/cassandra.cc index 4049b01..3df7a53 100644 --- a/libcassandra/cassandra.cc +++ b/libcassandra/cassandra.cc @@ -11,7 +11,7 @@ #include #include -#include +#include "../libgenthrift/Cassandra.h" #include "cassandra.h" #include "keyspace.h" diff --git a/libcassandra/cassandra.h b/libcassandra/cassandra.h index 4930498..279033b 100644 --- a/libcassandra/cassandra.h +++ b/libcassandra/cassandra.h @@ -15,7 +15,7 @@ #include #include -#include "libgenthrift/cassandra_types.h" +#include "../libgenthrift/cassandra_types.h" namespace org { diff --git a/libcassandra/cassandra_factory.cc b/libcassandra/cassandra_factory.cc index d314a81..3adfe6c 100644 --- a/libcassandra/cassandra_factory.cc +++ b/libcassandra/cassandra_factory.cc @@ -15,7 +15,7 @@ #include #include -#include +#include "../libgenthrift/Cassandra.h" #include "cassandra.h" #include "cassandra_factory.h" diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index ba20935..dd251f6 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -16,7 +16,7 @@ #include #include -#include +#include "../libgenthrift/Cassandra.h" #include "cassandra.h" #include "keyspace.h" diff --git a/libcassandra/keyspace.h b/libcassandra/keyspace.h index 4dccc37..3b907c9 100644 --- a/libcassandra/keyspace.h +++ b/libcassandra/keyspace.h @@ -14,7 +14,7 @@ #include #include -#include +#include "../libgenthrift/cassandra_types.h" namespace libcassandra { diff --git a/libcassandra/keyspace_factory.cc b/libcassandra/keyspace_factory.cc index 865f289..56a8624 100644 --- a/libcassandra/keyspace_factory.cc +++ b/libcassandra/keyspace_factory.cc @@ -14,7 +14,7 @@ #include #include -#include +#include "../libgenthrift/Cassandra.h" #include "cassandra.h" #include "keyspace.h" From 8b100356ba480822327c61a1d5b72e4a6b3340f2 Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Thu, 15 Jul 2010 21:39:48 -0700 Subject: [PATCH 10/22] Fix: Keyspace::remove() didn't work against super-column families. Add updated libtool-relared m4's. --- libcassandra/keyspace.cc | 2 +- m4/libtool.m4 | 1025 ++++++++++++++++++++------------------ m4/ltoptions.m4 | 13 +- m4/ltversion.m4 | 10 +- m4/lt~obsolete.m4 | 12 +- 5 files changed, 565 insertions(+), 497 deletions(-) diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index dd251f6..9ea7c4b 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -92,7 +92,7 @@ void Keyspace::remove(const string &key, col_path.column_family.assign(column_family); if (! super_column_name.empty()) { - col_path.column.assign(super_column_name); + col_path.super_column.assign(super_column_name); col_path.__isset.super_column= true; } if (! column_name.empty()) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 1e7ea47..22924a8 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,7 +1,8 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,7 +11,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -66,6 +68,7 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -82,6 +85,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -118,7 +123,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -138,6 +143,9 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -179,7 +187,6 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -193,23 +200,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -250,6 +240,28 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -408,7 +420,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -418,7 +430,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -517,12 +529,20 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -533,9 +553,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -543,16 +563,38 @@ for var in lt_decl_all_varnames([[ \ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -562,20 +604,11 @@ _LT_OUTPUT_LIBTOOL_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -601,7 +634,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -646,15 +679,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -831,11 +862,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -940,6 +973,31 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -967,7 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -987,7 +1045,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -995,7 +1057,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1041,170 +1103,65 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH @@ -1236,7 +1193,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1388,10 +1345,19 @@ if test -n "$RANLIB"; then esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1416,15 +1382,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1464,7 +1430,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1527,6 +1493,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1591,8 +1562,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1643,7 +1614,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1684,7 +1655,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1693,7 +1670,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1869,16 +1850,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2037,6 +2018,7 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2045,16 +2027,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2067,7 +2056,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2087,7 +2076,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2175,7 +2170,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2228,23 +2223,12 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -2344,6 +2328,19 @@ gnu*) hardcode_into_libs=yes ;; +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2386,8 +2383,10 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) @@ -2445,7 +2444,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -2454,16 +2453,21 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2472,7 +2476,7 @@ linux* | k*bsd*-gnu) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2485,18 +2489,6 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -2717,6 +2709,8 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2829,6 +2823,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2958,8 +2953,8 @@ case $host_os in fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3011,16 +3006,18 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3050,6 +3047,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3058,11 +3059,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3084,11 +3085,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3226,7 +3227,19 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3239,13 +3252,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3268,7 +3281,7 @@ AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3296,7 +3309,12 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3313,6 +3331,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3438,7 +3457,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3600,6 +3619,11 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3705,7 +3729,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3738,8 +3762,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3769,7 +3793,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -3801,7 +3825,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3905,6 +3929,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3947,6 +3977,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3989,7 +4026,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4010,7 +4047,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4022,25 +4059,25 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker + *Sun\ C*) + # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; @@ -4072,7 +4109,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4182,8 +4219,10 @@ m4_if([$1], [CXX], [ aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4194,9 +4233,6 @@ m4_if([$1], [CXX], [ cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; - linux* | k*bsd*-gnu) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4261,13 +4297,36 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4285,6 +4344,7 @@ dnl Note also adjust exclude_expsyms for C++ above. fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4300,11 +4360,12 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4340,6 +4401,7 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -4361,6 +4423,11 @@ _LT_EOF fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4376,7 +4443,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4390,11 +4457,12 @@ _LT_EOF tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4405,13 +4473,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4427,17 +4499,17 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4446,7 +4518,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -4558,8 +4630,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4621,7 +4695,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -4649,7 +4722,7 @@ _LT_EOF # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4664,8 +4737,13 @@ _LT_EOF # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4704,7 +4782,7 @@ _LT_EOF # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. @@ -4771,7 +4849,7 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' @@ -4790,7 +4868,7 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -4811,7 +4889,14 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4839,19 +4924,19 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4860,7 +4945,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -4913,17 +4998,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4933,13 +5018,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5130,36 +5215,38 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5329,37 +5416,21 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5381,6 +5452,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5483,7 +5556,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5595,7 +5668,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5610,8 +5683,13 @@ if test "$_lt_caught_CXX_error" != yes; then # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5644,6 +5722,7 @@ if test "$_lt_caught_CXX_error" != yes; then # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes @@ -5704,6 +5783,11 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5728,7 +5812,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5793,7 +5877,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5836,7 +5920,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5847,9 +5931,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5860,7 +5944,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5878,7 +5962,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5915,26 +5999,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5942,7 +6026,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5961,9 +6045,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5983,13 +6067,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6058,7 +6142,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6093,15 +6177,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6117,17 +6201,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6137,7 +6221,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6173,7 +6257,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6194,7 +6278,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6221,7 +6305,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6232,7 +6316,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6286,6 +6370,10 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6532,7 +6620,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6576,32 +6664,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6620,6 +6692,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6719,32 +6793,17 @@ AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6763,6 +6822,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6908,6 +6969,8 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7275,7 +7338,7 @@ _LT_EOF func_dirname () { # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else @@ -7286,7 +7349,7 @@ func_dirname () # func_basename file func_basename () { - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + func_basename_result=`$ECHO "${1}" | $SED "$basename"` } dnl func_dirname_and_basename @@ -7302,10 +7365,8 @@ dnl so there is no need for it here. func_stripname () { case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } @@ -7316,20 +7377,20 @@ my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_xform libobj-or-source func_xform () { - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` + func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 34151a3..17cfd51 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,13 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -125,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -133,13 +134,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index b8e154f..93fc771 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -9,15 +9,15 @@ # Generated from ltversion.in. -# serial 3012 ltversion.m4 +# serial 3175 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) +m4_define([LT_PACKAGE_VERSION], [2.2.10]) +m4_define([LT_PACKAGE_REVISION], [1.3175]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' +[macro_version='2.2.10' +macro_revision='1.3175' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index 637bb20..c573da9 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -90,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) From 3b21bdf81cb9f558b578ad523188937de471474d Mon Sep 17 00:00:00 2001 From: Hannes Schmidt Date: Wed, 21 Jul 2010 13:08:43 -0700 Subject: [PATCH 11/22] Fixed dependencies in Debian packaging. Added libgenthrift/configure.h to .gitignore. --- .gitignore | 1 + debian/changelog | 3 ++- debian/control | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 75ea4d9..fc54066 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ libcassandra/configure.h libgenthrift/.libs/ libgenthrift/.dirstamp libcassandra/.libs/ +libgenthrift/configure.h diff --git a/debian/changelog b/debian/changelog index f393ebb..315aa37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ libcassandra (0.1-0ubuntu1) lucid; urgency=low * Initial release. + * Fixed dependencies - -- Hannes Schmidt Tue, 06 Jul 2010 14:54:23 -0700 + -- Hannes Schmidt Wed, 21 Jul 2010 12:41:30 -0700 diff --git a/debian/control b/debian/control index e912d28..239be8c 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Standards-Version: 3.7.3 Package: libcassandra1 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} libthrift0 (>= 0.2.0) Description: Apache Cassandra C++ client library C++ wrapper library for the interface to Cassandra generated by Thrift. This library is based on the Java client Hector. @@ -27,7 +27,7 @@ Description: Apache Cassandra C++ client library Package: libcassandra-dev Architecture: any Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libcassandra0.6 +Depends: ${shlibs:Depends}, ${misc:Depends}, libcassandra1, libthrift-dev (>= 0.2.0) Description: Apache Cassandra C++ client library (development headers) A C++ wrapper library for the interface to Cassandra generated by Thrift. This library is based on the Java client Hector. From 47dc533028abe5a977f213517227f1bfb703b79d Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Thu, 26 Aug 2010 12:43:15 -0400 Subject: [PATCH 12/22] Revert "Trail upstream relocation of thrift headers" This reverts commit 48ce0c1e16560e7d9214206c4780235f150950d6. --- libcassandra/cassandra_factory.cc | 6 +++--- libcassandra/keyspace.cc | 6 +++--- libcassandra/keyspace_factory.cc | 6 +++--- libgenthrift/Cassandra.h | 2 +- libgenthrift/Cassandra_server.skeleton.cpp | 8 ++++---- libgenthrift/cassandra_types.h | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libcassandra/cassandra_factory.cc b/libcassandra/cassandra_factory.cc index 3adfe6c..9b098bc 100644 --- a/libcassandra/cassandra_factory.cc +++ b/libcassandra/cassandra_factory.cc @@ -11,9 +11,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "../libgenthrift/Cassandra.h" diff --git a/libcassandra/keyspace.cc b/libcassandra/keyspace.cc index c634ef6..3adc999 100644 --- a/libcassandra/keyspace.cc +++ b/libcassandra/keyspace.cc @@ -12,9 +12,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "../libgenthrift/Cassandra.h" diff --git a/libcassandra/keyspace_factory.cc b/libcassandra/keyspace_factory.cc index 56a8624..9cf8952 100644 --- a/libcassandra/keyspace_factory.cc +++ b/libcassandra/keyspace_factory.cc @@ -10,9 +10,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "../libgenthrift/Cassandra.h" diff --git a/libgenthrift/Cassandra.h b/libgenthrift/Cassandra.h index 6596d4e..bcd7a05 100644 --- a/libgenthrift/Cassandra.h +++ b/libgenthrift/Cassandra.h @@ -6,7 +6,7 @@ #ifndef Cassandra_H #define Cassandra_H -#include +#include #include "cassandra_types.h" namespace org { namespace apache { namespace cassandra { diff --git a/libgenthrift/Cassandra_server.skeleton.cpp b/libgenthrift/Cassandra_server.skeleton.cpp index 5699091..03e64be 100644 --- a/libgenthrift/Cassandra_server.skeleton.cpp +++ b/libgenthrift/Cassandra_server.skeleton.cpp @@ -2,10 +2,10 @@ // You should copy it to another filename to avoid overwriting it. #include "Cassandra.h" -#include -#include -#include -#include +#include +#include +#include +#include using namespace ::apache::thrift; using namespace ::apache::thrift::protocol; diff --git a/libgenthrift/cassandra_types.h b/libgenthrift/cassandra_types.h index 53f7cae..0e84217 100644 --- a/libgenthrift/cassandra_types.h +++ b/libgenthrift/cassandra_types.h @@ -6,9 +6,9 @@ #ifndef cassandra_TYPES_H #define cassandra_TYPES_H -#include -#include -#include +#include +#include +#include From 6f4a21341f6019f2826074a7dc753a3d972b80f8 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Thu, 26 Aug 2010 15:39:25 -0400 Subject: [PATCH 13/22] Fix broken detection of libthrift --- m4/pandora_have_thrift.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/pandora_have_thrift.m4 b/m4/pandora_have_thrift.m4 index 180d051..b4a2a7d 100644 --- a/m4/pandora_have_thrift.m4 +++ b/m4/pandora_have_thrift.m4 @@ -25,10 +25,10 @@ AC_DEFUN([_PANDORA_SEARCH_THRIFT],[ ]) AC_LANG_POP() ],[ - ac_cv_thrift="no" + ac_cv_libthrift="no" ]) - AM_CONDITIONAL(HAVE_THRIFT, [test "x${ac_cv_thrift}" = "xyes"]) + AM_CONDITIONAL(HAVE_LIBTHRIFT, [test "x${ac_cv_libthrift}" = "xyes"]) ]) @@ -38,7 +38,7 @@ AC_DEFUN([PANDORA_HAVE_THRIFT],[ AC_DEFUN([PANDORA_REQUIRE_THRIFT],[ AC_REQUIRE([PANDORA_HAVE_THRIFT]) - AS_IF([test x$ac_cv_thrift= xno],[ + AS_IF([test "x$ac_cv_libthrift" = "xno"],[ AC_MSG_ERROR([thrift required for ${PACKAGE}]) ]) ]) From c353de590c79d02962d81d194b7f320551dee011 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Fri, 27 Aug 2010 11:07:00 -0400 Subject: [PATCH 14/22] Compiling now works again (Add THRIFT_PREFIX/include/thrift to include path) --- configure.ac | 1 + m4/pandora_have_thrift.m4 | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 658a8ca..39c4d9c 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,7 @@ echo " * C++ cstdint location: $ac_cv_cxx_cstdint" echo " * C++ hash_map location: $ac_cv_cxx_hash_map" echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace" echo " * C++ shared_ptr namespace: $ac_cv_shared_ptr_namespace" +echo " * THRIFT prefix: $LIBTHRIFT_PREFIX" echo "" echo "---" diff --git a/m4/pandora_have_thrift.m4 b/m4/pandora_have_thrift.m4 index b4a2a7d..a922ac7 100644 --- a/m4/pandora_have_thrift.m4 +++ b/m4/pandora_have_thrift.m4 @@ -24,6 +24,13 @@ AC_DEFUN([_PANDORA_SEARCH_THRIFT],[ apache::thrift::TOutput test_output; ]) AC_LANG_POP() + + dnl Thrift's generated code as well as its own headers include thrift headers + dnl without a "thrift/" prefix, which means even though the above adds -I PREFIX/include + dnl We also need -I PREFIX/include/thrift + AC_LIB_APPENDTOVAR([INCTHRIFT], [-I]$LIBTHRIFT_PREFIX[/include/thrift]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [-I]$LIBTHRIFT_PREFIX[/include/thrift]) + ],[ ac_cv_libthrift="no" ]) From c5c4967b9df1973751e46aed43239c86619121bd Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Fri, 27 Aug 2010 12:19:28 -0400 Subject: [PATCH 15/22] Bump up to thrift 0.4, with generated interface version 2.2.0 (from cassandra 0.6.4) --- debian/control | 6 +- libgenthrift/Cassandra.cpp | 257 ++++++++ libgenthrift/Cassandra.h | 702 ++++++++++++++------- libgenthrift/Cassandra_server.skeleton.cpp | 5 + libgenthrift/cassandra_constants.cpp | 2 +- libgenthrift/cassandra_constants.h | 2 +- libgenthrift/cassandra_types.h | 99 +-- 7 files changed, 800 insertions(+), 273 deletions(-) diff --git a/debian/control b/debian/control index 239be8c..3055efe 100644 --- a/debian/control +++ b/debian/control @@ -3,13 +3,13 @@ Section: devel Priority: extra Build-Depends: debhelper (>= 5), build-essential, mono-gmcs, python-dev, ant, libmono-dev, erlang-base, ruby1.8-dev, autoconf, python-support, automake, - pkg-config, libtool, libboost-dev, libthrift-dev (>= 0.2.0), cdbs + pkg-config, libtool, libboost-dev, libthrift-dev (>= 0.4.0), cdbs Maintainer: Hannes Schmidt Standards-Version: 3.7.3 Package: libcassandra1 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} libthrift0 (>= 0.2.0) +Depends: ${shlibs:Depends}, ${misc:Depends} libthrift0 (>= 0.4.0) Description: Apache Cassandra C++ client library C++ wrapper library for the interface to Cassandra generated by Thrift. This library is based on the Java client Hector. @@ -27,7 +27,7 @@ Description: Apache Cassandra C++ client library Package: libcassandra-dev Architecture: any Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libcassandra1, libthrift-dev (>= 0.2.0) +Depends: ${shlibs:Depends}, ${misc:Depends}, libcassandra1, libthrift-dev (>= 0.4.0) Description: Apache Cassandra C++ client library (development headers) A C++ wrapper library for the interface to Cassandra generated by Thrift. This library is based on the Java client Hector. diff --git a/libgenthrift/Cassandra.cpp b/libgenthrift/Cassandra.cpp index 3be207a..bea8401 100644 --- a/libgenthrift/Cassandra.cpp +++ b/libgenthrift/Cassandra.cpp @@ -4634,6 +4634,14 @@ uint32_t Cassandra_describe_ring_result::read(::apache::thrift::protocol::TProto xfer += iprot->skip(ftype); } break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -4664,6 +4672,10 @@ uint32_t Cassandra_describe_ring_result::write(::apache::thrift::protocol::TProt xfer += oprot->writeListEnd(); } xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); @@ -4710,6 +4722,158 @@ uint32_t Cassandra_describe_ring_presult::read(::apache::thrift::protocol::TProt xfer += iprot->skip(ftype); } break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -6407,9 +6571,71 @@ void CassandraClient::recv_describe_ring(std::vector & _return) // _return pointer has now been filled return; } + if (result.__isset.ire) { + throw result.ire; + } throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_ring failed: unknown result"); } +void CassandraClient::describe_partitioner(std::string& _return) +{ + send_describe_partitioner(); + recv_describe_partitioner(_return); +} + +void CassandraClient::send_describe_partitioner() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_partitioner_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->flush(); + oprot_->getTransport()->writeEnd(); +} + +void CassandraClient::recv_describe_partitioner(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + } + if (fname.compare("describe_partitioner") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); + } + Cassandra_describe_partitioner_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_partitioner failed: unknown result"); +} + void CassandraClient::describe_keyspace(std::map > & _return, const std::string& keyspace) { send_describe_keyspace(keyspace); @@ -7170,6 +7396,9 @@ void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift:: try { iface_->describe_ring(result.success, args.keyspace); result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; } catch (const std::exception& e) { ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_EXCEPTION, seqid); @@ -7187,6 +7416,34 @@ void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift:: oprot->getTransport()->writeEnd(); } +void CassandraProcessor::process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +{ + Cassandra_describe_partitioner_args args; + args.read(iprot); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + + Cassandra_describe_partitioner_result result; + try { + iface_->describe_partitioner(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); + return; + } + + oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->flush(); + oprot->getTransport()->writeEnd(); +} + void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) { Cassandra_describe_keyspace_args args; diff --git a/libgenthrift/Cassandra.h b/libgenthrift/Cassandra.h index bcd7a05..7dcea2a 100644 --- a/libgenthrift/Cassandra.h +++ b/libgenthrift/Cassandra.h @@ -32,6 +32,7 @@ class CassandraIf { virtual void describe_cluster_name(std::string& _return) = 0; virtual void describe_version(std::string& _return) = 0; virtual void describe_ring(std::vector & _return, const std::string& keyspace) = 0; + virtual void describe_partitioner(std::string& _return) = 0; virtual void describe_keyspace(std::map > & _return, const std::string& keyspace) = 0; virtual void describe_splits(std::vector & _return, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) = 0; }; @@ -94,6 +95,9 @@ class CassandraNull : virtual public CassandraIf { void describe_ring(std::vector & /* _return */, const std::string& /* keyspace */) { return; } + void describe_partitioner(std::string& /* _return */) { + return; + } void describe_keyspace(std::map > & /* _return */, const std::string& /* keyspace */) { return; } @@ -102,6 +106,7 @@ class CassandraNull : virtual public CassandraIf { } }; + class Cassandra_login_args { public: @@ -132,6 +137,7 @@ class Cassandra_login_args { }; + class Cassandra_login_pargs { public: @@ -145,6 +151,12 @@ class Cassandra_login_pargs { }; +typedef struct _Cassandra_login_result__isset { + _Cassandra_login_result__isset() : authnx(false), authzx(false) {} + bool authnx; + bool authzx; +} _Cassandra_login_result__isset; + class Cassandra_login_result { public: @@ -156,11 +168,7 @@ class Cassandra_login_result { AuthenticationException authnx; AuthorizationException authzx; - struct __isset { - __isset() : authnx(false), authzx(false) {} - bool authnx; - bool authzx; - } __isset; + _Cassandra_login_result__isset __isset; bool operator == (const Cassandra_login_result & rhs) const { @@ -181,6 +189,12 @@ class Cassandra_login_result { }; +typedef struct _Cassandra_login_presult__isset { + _Cassandra_login_presult__isset() : authnx(false), authzx(false) {} + bool authnx; + bool authzx; +} _Cassandra_login_presult__isset; + class Cassandra_login_presult { public: @@ -190,16 +204,13 @@ class Cassandra_login_presult { AuthenticationException authnx; AuthorizationException authzx; - struct __isset { - __isset() : authnx(false), authzx(false) {} - bool authnx; - bool authzx; - } __isset; + _Cassandra_login_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_args { public: @@ -238,6 +249,7 @@ class Cassandra_get_args { }; + class Cassandra_get_pargs { public: @@ -253,6 +265,15 @@ class Cassandra_get_pargs { }; +typedef struct _Cassandra_get_result__isset { + _Cassandra_get_result__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} + bool success; + bool ire; + bool nfe; + bool ue; + bool te; +} _Cassandra_get_result__isset; + class Cassandra_get_result { public: @@ -267,14 +288,7 @@ class Cassandra_get_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} - bool success; - bool ire; - bool nfe; - bool ue; - bool te; - } __isset; + _Cassandra_get_result__isset __isset; bool operator == (const Cassandra_get_result & rhs) const { @@ -301,6 +315,15 @@ class Cassandra_get_result { }; +typedef struct _Cassandra_get_presult__isset { + _Cassandra_get_presult__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} + bool success; + bool ire; + bool nfe; + bool ue; + bool te; +} _Cassandra_get_presult__isset; + class Cassandra_get_presult { public: @@ -313,19 +336,13 @@ class Cassandra_get_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} - bool success; - bool ire; - bool nfe; - bool ue; - bool te; - } __isset; + _Cassandra_get_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_slice_args { public: @@ -367,6 +384,7 @@ class Cassandra_get_slice_args { }; + class Cassandra_get_slice_pargs { public: @@ -383,6 +401,14 @@ class Cassandra_get_slice_pargs { }; +typedef struct _Cassandra_get_slice_result__isset { + _Cassandra_get_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_slice_result__isset; + class Cassandra_get_slice_result { public: @@ -396,13 +422,7 @@ class Cassandra_get_slice_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_slice_result__isset __isset; bool operator == (const Cassandra_get_slice_result & rhs) const { @@ -427,6 +447,14 @@ class Cassandra_get_slice_result { }; +typedef struct _Cassandra_get_slice_presult__isset { + _Cassandra_get_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_slice_presult__isset; + class Cassandra_get_slice_presult { public: @@ -438,18 +466,13 @@ class Cassandra_get_slice_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_slice_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_multiget_args { public: @@ -488,6 +511,7 @@ class Cassandra_multiget_args { }; + class Cassandra_multiget_pargs { public: @@ -503,6 +527,14 @@ class Cassandra_multiget_pargs { }; +typedef struct _Cassandra_multiget_result__isset { + _Cassandra_multiget_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_result__isset; + class Cassandra_multiget_result { public: @@ -516,13 +548,7 @@ class Cassandra_multiget_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_multiget_result__isset __isset; bool operator == (const Cassandra_multiget_result & rhs) const { @@ -547,6 +573,14 @@ class Cassandra_multiget_result { }; +typedef struct _Cassandra_multiget_presult__isset { + _Cassandra_multiget_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_presult__isset; + class Cassandra_multiget_presult { public: @@ -558,18 +592,13 @@ class Cassandra_multiget_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_multiget_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_multiget_slice_args { public: @@ -611,6 +640,7 @@ class Cassandra_multiget_slice_args { }; + class Cassandra_multiget_slice_pargs { public: @@ -627,6 +657,14 @@ class Cassandra_multiget_slice_pargs { }; +typedef struct _Cassandra_multiget_slice_result__isset { + _Cassandra_multiget_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_slice_result__isset; + class Cassandra_multiget_slice_result { public: @@ -640,13 +678,7 @@ class Cassandra_multiget_slice_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_multiget_slice_result__isset __isset; bool operator == (const Cassandra_multiget_slice_result & rhs) const { @@ -671,6 +703,14 @@ class Cassandra_multiget_slice_result { }; +typedef struct _Cassandra_multiget_slice_presult__isset { + _Cassandra_multiget_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_slice_presult__isset; + class Cassandra_multiget_slice_presult { public: @@ -682,18 +722,13 @@ class Cassandra_multiget_slice_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_multiget_slice_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_count_args { public: @@ -732,6 +767,7 @@ class Cassandra_get_count_args { }; + class Cassandra_get_count_pargs { public: @@ -747,6 +783,14 @@ class Cassandra_get_count_pargs { }; +typedef struct _Cassandra_get_count_result__isset { + _Cassandra_get_count_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_count_result__isset; + class Cassandra_get_count_result { public: @@ -760,13 +804,7 @@ class Cassandra_get_count_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_count_result__isset __isset; bool operator == (const Cassandra_get_count_result & rhs) const { @@ -791,6 +829,14 @@ class Cassandra_get_count_result { }; +typedef struct _Cassandra_get_count_presult__isset { + _Cassandra_get_count_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_count_presult__isset; + class Cassandra_get_count_presult { public: @@ -802,18 +848,13 @@ class Cassandra_get_count_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_count_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_range_slice_args { public: @@ -861,6 +902,7 @@ class Cassandra_get_range_slice_args { }; + class Cassandra_get_range_slice_pargs { public: @@ -879,6 +921,14 @@ class Cassandra_get_range_slice_pargs { }; +typedef struct _Cassandra_get_range_slice_result__isset { + _Cassandra_get_range_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slice_result__isset; + class Cassandra_get_range_slice_result { public: @@ -892,13 +942,7 @@ class Cassandra_get_range_slice_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_range_slice_result__isset __isset; bool operator == (const Cassandra_get_range_slice_result & rhs) const { @@ -923,6 +967,14 @@ class Cassandra_get_range_slice_result { }; +typedef struct _Cassandra_get_range_slice_presult__isset { + _Cassandra_get_range_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slice_presult__isset; + class Cassandra_get_range_slice_presult { public: @@ -934,18 +986,13 @@ class Cassandra_get_range_slice_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_range_slice_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_range_slices_args { public: @@ -987,6 +1034,7 @@ class Cassandra_get_range_slices_args { }; + class Cassandra_get_range_slices_pargs { public: @@ -1003,6 +1051,14 @@ class Cassandra_get_range_slices_pargs { }; +typedef struct _Cassandra_get_range_slices_result__isset { + _Cassandra_get_range_slices_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slices_result__isset; + class Cassandra_get_range_slices_result { public: @@ -1016,13 +1072,7 @@ class Cassandra_get_range_slices_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_range_slices_result__isset __isset; bool operator == (const Cassandra_get_range_slices_result & rhs) const { @@ -1047,6 +1097,14 @@ class Cassandra_get_range_slices_result { }; +typedef struct _Cassandra_get_range_slices_presult__isset { + _Cassandra_get_range_slices_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slices_presult__isset; + class Cassandra_get_range_slices_presult { public: @@ -1058,23 +1116,18 @@ class Cassandra_get_range_slices_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : success(false), ire(false), ue(false), te(false) {} - bool success; - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_get_range_slices_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_insert_args { public: Cassandra_insert_args() : keyspace(""), key(""), value(""), timestamp(0) { - consistency_level = (ConsistencyLevel)0; + consistency_level = (ConsistencyLevel)1; } @@ -1114,6 +1167,7 @@ class Cassandra_insert_args { }; + class Cassandra_insert_pargs { public: @@ -1131,6 +1185,13 @@ class Cassandra_insert_pargs { }; +typedef struct _Cassandra_insert_result__isset { + _Cassandra_insert_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_insert_result__isset; + class Cassandra_insert_result { public: @@ -1143,12 +1204,7 @@ class Cassandra_insert_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_insert_result__isset __isset; bool operator == (const Cassandra_insert_result & rhs) const { @@ -1171,6 +1227,13 @@ class Cassandra_insert_result { }; +typedef struct _Cassandra_insert_presult__isset { + _Cassandra_insert_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_insert_presult__isset; + class Cassandra_insert_presult { public: @@ -1181,22 +1244,18 @@ class Cassandra_insert_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_insert_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_batch_insert_args { public: Cassandra_batch_insert_args() : keyspace(""), key("") { - consistency_level = (ConsistencyLevel)0; + consistency_level = (ConsistencyLevel)1; } @@ -1230,6 +1289,7 @@ class Cassandra_batch_insert_args { }; + class Cassandra_batch_insert_pargs { public: @@ -1245,6 +1305,13 @@ class Cassandra_batch_insert_pargs { }; +typedef struct _Cassandra_batch_insert_result__isset { + _Cassandra_batch_insert_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_insert_result__isset; + class Cassandra_batch_insert_result { public: @@ -1257,12 +1324,7 @@ class Cassandra_batch_insert_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_batch_insert_result__isset __isset; bool operator == (const Cassandra_batch_insert_result & rhs) const { @@ -1285,6 +1347,13 @@ class Cassandra_batch_insert_result { }; +typedef struct _Cassandra_batch_insert_presult__isset { + _Cassandra_batch_insert_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_insert_presult__isset; + class Cassandra_batch_insert_presult { public: @@ -1295,22 +1364,22 @@ class Cassandra_batch_insert_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_batch_insert_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; +typedef struct _Cassandra_remove_args__isset { + _Cassandra_remove_args__isset() : consistency_level(false) {} + bool consistency_level; +} _Cassandra_remove_args__isset; + class Cassandra_remove_args { public: Cassandra_remove_args() : keyspace(""), key(""), timestamp(0) { - consistency_level = (ConsistencyLevel)0; + consistency_level = (ConsistencyLevel)1; } @@ -1322,10 +1391,7 @@ class Cassandra_remove_args { int64_t timestamp; ConsistencyLevel consistency_level; - struct __isset { - __isset() : consistency_level(false) {} - bool consistency_level; - } __isset; + _Cassandra_remove_args__isset __isset; bool operator == (const Cassandra_remove_args & rhs) const { @@ -1352,6 +1418,7 @@ class Cassandra_remove_args { }; + class Cassandra_remove_pargs { public: @@ -1368,6 +1435,13 @@ class Cassandra_remove_pargs { }; +typedef struct _Cassandra_remove_result__isset { + _Cassandra_remove_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_result__isset; + class Cassandra_remove_result { public: @@ -1380,12 +1454,7 @@ class Cassandra_remove_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_remove_result__isset __isset; bool operator == (const Cassandra_remove_result & rhs) const { @@ -1408,6 +1477,13 @@ class Cassandra_remove_result { }; +typedef struct _Cassandra_remove_presult__isset { + _Cassandra_remove_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_presult__isset; + class Cassandra_remove_presult { public: @@ -1418,22 +1494,18 @@ class Cassandra_remove_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_remove_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_batch_mutate_args { public: Cassandra_batch_mutate_args() : keyspace("") { - consistency_level = (ConsistencyLevel)0; + consistency_level = (ConsistencyLevel)1; } @@ -1464,6 +1536,7 @@ class Cassandra_batch_mutate_args { }; + class Cassandra_batch_mutate_pargs { public: @@ -1478,6 +1551,13 @@ class Cassandra_batch_mutate_pargs { }; +typedef struct _Cassandra_batch_mutate_result__isset { + _Cassandra_batch_mutate_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_mutate_result__isset; + class Cassandra_batch_mutate_result { public: @@ -1490,12 +1570,7 @@ class Cassandra_batch_mutate_result { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_batch_mutate_result__isset __isset; bool operator == (const Cassandra_batch_mutate_result & rhs) const { @@ -1518,6 +1593,13 @@ class Cassandra_batch_mutate_result { }; +typedef struct _Cassandra_batch_mutate_presult__isset { + _Cassandra_batch_mutate_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_mutate_presult__isset; + class Cassandra_batch_mutate_presult { public: @@ -1528,17 +1610,13 @@ class Cassandra_batch_mutate_presult { UnavailableException ue; TimedOutException te; - struct __isset { - __isset() : ire(false), ue(false), te(false) {} - bool ire; - bool ue; - bool te; - } __isset; + _Cassandra_batch_mutate_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_string_property_args { public: @@ -1566,6 +1644,7 @@ class Cassandra_get_string_property_args { }; + class Cassandra_get_string_property_pargs { public: @@ -1578,6 +1657,11 @@ class Cassandra_get_string_property_pargs { }; +typedef struct _Cassandra_get_string_property_result__isset { + _Cassandra_get_string_property_result__isset() : success(false) {} + bool success; +} _Cassandra_get_string_property_result__isset; + class Cassandra_get_string_property_result { public: @@ -1588,10 +1672,7 @@ class Cassandra_get_string_property_result { std::string success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_get_string_property_result__isset __isset; bool operator == (const Cassandra_get_string_property_result & rhs) const { @@ -1610,6 +1691,11 @@ class Cassandra_get_string_property_result { }; +typedef struct _Cassandra_get_string_property_presult__isset { + _Cassandra_get_string_property_presult__isset() : success(false) {} + bool success; +} _Cassandra_get_string_property_presult__isset; + class Cassandra_get_string_property_presult { public: @@ -1618,15 +1704,13 @@ class Cassandra_get_string_property_presult { std::string* success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_get_string_property_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_get_string_list_property_args { public: @@ -1654,6 +1738,7 @@ class Cassandra_get_string_list_property_args { }; + class Cassandra_get_string_list_property_pargs { public: @@ -1666,6 +1751,11 @@ class Cassandra_get_string_list_property_pargs { }; +typedef struct _Cassandra_get_string_list_property_result__isset { + _Cassandra_get_string_list_property_result__isset() : success(false) {} + bool success; +} _Cassandra_get_string_list_property_result__isset; + class Cassandra_get_string_list_property_result { public: @@ -1676,10 +1766,7 @@ class Cassandra_get_string_list_property_result { std::vector success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_get_string_list_property_result__isset __isset; bool operator == (const Cassandra_get_string_list_property_result & rhs) const { @@ -1698,6 +1785,11 @@ class Cassandra_get_string_list_property_result { }; +typedef struct _Cassandra_get_string_list_property_presult__isset { + _Cassandra_get_string_list_property_presult__isset() : success(false) {} + bool success; +} _Cassandra_get_string_list_property_presult__isset; + class Cassandra_get_string_list_property_presult { public: @@ -1706,15 +1798,13 @@ class Cassandra_get_string_list_property_presult { std::vector * success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_get_string_list_property_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_describe_keyspaces_args { public: @@ -1739,6 +1829,7 @@ class Cassandra_describe_keyspaces_args { }; + class Cassandra_describe_keyspaces_pargs { public: @@ -1750,6 +1841,11 @@ class Cassandra_describe_keyspaces_pargs { }; +typedef struct _Cassandra_describe_keyspaces_result__isset { + _Cassandra_describe_keyspaces_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_keyspaces_result__isset; + class Cassandra_describe_keyspaces_result { public: @@ -1760,10 +1856,7 @@ class Cassandra_describe_keyspaces_result { std::set success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_keyspaces_result__isset __isset; bool operator == (const Cassandra_describe_keyspaces_result & rhs) const { @@ -1782,6 +1875,11 @@ class Cassandra_describe_keyspaces_result { }; +typedef struct _Cassandra_describe_keyspaces_presult__isset { + _Cassandra_describe_keyspaces_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_keyspaces_presult__isset; + class Cassandra_describe_keyspaces_presult { public: @@ -1790,15 +1888,13 @@ class Cassandra_describe_keyspaces_presult { std::set * success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_keyspaces_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_describe_cluster_name_args { public: @@ -1823,6 +1919,7 @@ class Cassandra_describe_cluster_name_args { }; + class Cassandra_describe_cluster_name_pargs { public: @@ -1834,6 +1931,11 @@ class Cassandra_describe_cluster_name_pargs { }; +typedef struct _Cassandra_describe_cluster_name_result__isset { + _Cassandra_describe_cluster_name_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_cluster_name_result__isset; + class Cassandra_describe_cluster_name_result { public: @@ -1844,10 +1946,7 @@ class Cassandra_describe_cluster_name_result { std::string success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_cluster_name_result__isset __isset; bool operator == (const Cassandra_describe_cluster_name_result & rhs) const { @@ -1866,6 +1965,11 @@ class Cassandra_describe_cluster_name_result { }; +typedef struct _Cassandra_describe_cluster_name_presult__isset { + _Cassandra_describe_cluster_name_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_cluster_name_presult__isset; + class Cassandra_describe_cluster_name_presult { public: @@ -1874,15 +1978,13 @@ class Cassandra_describe_cluster_name_presult { std::string* success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_cluster_name_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_describe_version_args { public: @@ -1907,6 +2009,7 @@ class Cassandra_describe_version_args { }; + class Cassandra_describe_version_pargs { public: @@ -1918,6 +2021,11 @@ class Cassandra_describe_version_pargs { }; +typedef struct _Cassandra_describe_version_result__isset { + _Cassandra_describe_version_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_version_result__isset; + class Cassandra_describe_version_result { public: @@ -1928,10 +2036,7 @@ class Cassandra_describe_version_result { std::string success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_version_result__isset __isset; bool operator == (const Cassandra_describe_version_result & rhs) const { @@ -1950,6 +2055,11 @@ class Cassandra_describe_version_result { }; +typedef struct _Cassandra_describe_version_presult__isset { + _Cassandra_describe_version_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_version_presult__isset; + class Cassandra_describe_version_presult { public: @@ -1958,15 +2068,13 @@ class Cassandra_describe_version_presult { std::string* success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_version_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_describe_ring_args { public: @@ -1994,6 +2102,7 @@ class Cassandra_describe_ring_args { }; + class Cassandra_describe_ring_pargs { public: @@ -2006,6 +2115,12 @@ class Cassandra_describe_ring_pargs { }; +typedef struct _Cassandra_describe_ring_result__isset { + _Cassandra_describe_ring_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_ring_result__isset; + class Cassandra_describe_ring_result { public: @@ -2015,16 +2130,16 @@ class Cassandra_describe_ring_result { virtual ~Cassandra_describe_ring_result() throw() {} std::vector success; + InvalidRequestException ire; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_ring_result__isset __isset; bool operator == (const Cassandra_describe_ring_result & rhs) const { if (!(success == rhs.success)) return false; + if (!(ire == rhs.ire)) + return false; return true; } bool operator != (const Cassandra_describe_ring_result &rhs) const { @@ -2038,6 +2153,12 @@ class Cassandra_describe_ring_result { }; +typedef struct _Cassandra_describe_ring_presult__isset { + _Cassandra_describe_ring_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_ring_presult__isset; + class Cassandra_describe_ring_presult { public: @@ -2045,16 +2166,105 @@ class Cassandra_describe_ring_presult { virtual ~Cassandra_describe_ring_presult() throw() {} std::vector * success; + InvalidRequestException ire; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_ring_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + +class Cassandra_describe_partitioner_args { + public: + + Cassandra_describe_partitioner_args() { + } + + virtual ~Cassandra_describe_partitioner_args() throw() {} + + + bool operator == (const Cassandra_describe_partitioner_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_partitioner_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_partitioner_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_partitioner_pargs { + public: + + + virtual ~Cassandra_describe_partitioner_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_partitioner_result__isset { + _Cassandra_describe_partitioner_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_partitioner_result__isset; + +class Cassandra_describe_partitioner_result { + public: + + Cassandra_describe_partitioner_result() : success("") { + } + + virtual ~Cassandra_describe_partitioner_result() throw() {} + + std::string success; + + _Cassandra_describe_partitioner_result__isset __isset; + + bool operator == (const Cassandra_describe_partitioner_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Cassandra_describe_partitioner_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_partitioner_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_partitioner_presult__isset { + _Cassandra_describe_partitioner_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_partitioner_presult__isset; + +class Cassandra_describe_partitioner_presult { + public: + + + virtual ~Cassandra_describe_partitioner_presult() throw() {} + + std::string* success; + + _Cassandra_describe_partitioner_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + class Cassandra_describe_keyspace_args { public: @@ -2082,6 +2292,7 @@ class Cassandra_describe_keyspace_args { }; + class Cassandra_describe_keyspace_pargs { public: @@ -2094,6 +2305,12 @@ class Cassandra_describe_keyspace_pargs { }; +typedef struct _Cassandra_describe_keyspace_result__isset { + _Cassandra_describe_keyspace_result__isset() : success(false), nfe(false) {} + bool success; + bool nfe; +} _Cassandra_describe_keyspace_result__isset; + class Cassandra_describe_keyspace_result { public: @@ -2105,11 +2322,7 @@ class Cassandra_describe_keyspace_result { std::map > success; NotFoundException nfe; - struct __isset { - __isset() : success(false), nfe(false) {} - bool success; - bool nfe; - } __isset; + _Cassandra_describe_keyspace_result__isset __isset; bool operator == (const Cassandra_describe_keyspace_result & rhs) const { @@ -2130,6 +2343,12 @@ class Cassandra_describe_keyspace_result { }; +typedef struct _Cassandra_describe_keyspace_presult__isset { + _Cassandra_describe_keyspace_presult__isset() : success(false), nfe(false) {} + bool success; + bool nfe; +} _Cassandra_describe_keyspace_presult__isset; + class Cassandra_describe_keyspace_presult { public: @@ -2139,16 +2358,13 @@ class Cassandra_describe_keyspace_presult { std::map > * success; NotFoundException nfe; - struct __isset { - __isset() : success(false), nfe(false) {} - bool success; - bool nfe; - } __isset; + _Cassandra_describe_keyspace_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); }; + class Cassandra_describe_splits_args { public: @@ -2182,6 +2398,7 @@ class Cassandra_describe_splits_args { }; + class Cassandra_describe_splits_pargs { public: @@ -2196,6 +2413,11 @@ class Cassandra_describe_splits_pargs { }; +typedef struct _Cassandra_describe_splits_result__isset { + _Cassandra_describe_splits_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_splits_result__isset; + class Cassandra_describe_splits_result { public: @@ -2206,10 +2428,7 @@ class Cassandra_describe_splits_result { std::vector success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_splits_result__isset __isset; bool operator == (const Cassandra_describe_splits_result & rhs) const { @@ -2228,6 +2447,11 @@ class Cassandra_describe_splits_result { }; +typedef struct _Cassandra_describe_splits_presult__isset { + _Cassandra_describe_splits_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_splits_presult__isset; + class Cassandra_describe_splits_presult { public: @@ -2236,10 +2460,7 @@ class Cassandra_describe_splits_presult { std::vector * success; - struct __isset { - __isset() : success(false) {} - bool success; - } __isset; + _Cassandra_describe_splits_presult__isset __isset; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); @@ -2319,6 +2540,9 @@ class CassandraClient : virtual public CassandraIf { void describe_ring(std::vector & _return, const std::string& keyspace); void send_describe_ring(const std::string& keyspace); void recv_describe_ring(std::vector & _return); + void describe_partitioner(std::string& _return); + void send_describe_partitioner(); + void recv_describe_partitioner(std::string& _return); void describe_keyspace(std::map > & _return, const std::string& keyspace); void send_describe_keyspace(const std::string& keyspace); void recv_describe_keyspace(std::map > & _return); @@ -2356,6 +2580,7 @@ class CassandraProcessor : virtual public ::apache::thrift::TProcessor { void process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + void process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); void process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); public: @@ -2379,6 +2604,7 @@ class CassandraProcessor : virtual public ::apache::thrift::TProcessor { processMap_["describe_cluster_name"] = &CassandraProcessor::process_describe_cluster_name; processMap_["describe_version"] = &CassandraProcessor::process_describe_version; processMap_["describe_ring"] = &CassandraProcessor::process_describe_ring; + processMap_["describe_partitioner"] = &CassandraProcessor::process_describe_partitioner; processMap_["describe_keyspace"] = &CassandraProcessor::process_describe_keyspace; processMap_["describe_splits"] = &CassandraProcessor::process_describe_splits; } @@ -2589,6 +2815,18 @@ class CassandraMultiface : virtual public CassandraIf { } } + void describe_partitioner(std::string& _return) { + uint32_t sz = ifaces_.size(); + for (uint32_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_partitioner(_return); + return; + } else { + ifaces_[i]->describe_partitioner(_return); + } + } + } + void describe_keyspace(std::map > & _return, const std::string& keyspace) { uint32_t sz = ifaces_.size(); for (uint32_t i = 0; i < sz; ++i) { diff --git a/libgenthrift/Cassandra_server.skeleton.cpp b/libgenthrift/Cassandra_server.skeleton.cpp index 03e64be..30a1ca4 100644 --- a/libgenthrift/Cassandra_server.skeleton.cpp +++ b/libgenthrift/Cassandra_server.skeleton.cpp @@ -112,6 +112,11 @@ class CassandraHandler : virtual public CassandraIf { printf("describe_ring\n"); } + void describe_partitioner(std::string& _return) { + // Your implementation goes here + printf("describe_partitioner\n"); + } + void describe_keyspace(std::map > & _return, const std::string& keyspace) { // Your implementation goes here printf("describe_keyspace\n"); diff --git a/libgenthrift/cassandra_constants.cpp b/libgenthrift/cassandra_constants.cpp index 3bf31a1..0ee4fb8 100644 --- a/libgenthrift/cassandra_constants.cpp +++ b/libgenthrift/cassandra_constants.cpp @@ -10,7 +10,7 @@ namespace org { namespace apache { namespace cassandra { const cassandraConstants g_cassandra_constants; cassandraConstants::cassandraConstants() { - VERSION = "2.1.0"; + VERSION = "2.2.0"; } diff --git a/libgenthrift/cassandra_constants.h b/libgenthrift/cassandra_constants.h index 84109a2..7e121f4 100644 --- a/libgenthrift/cassandra_constants.h +++ b/libgenthrift/cassandra_constants.h @@ -6,7 +6,7 @@ #ifndef cassandra_CONSTANTS_H #define cassandra_CONSTANTS_H -#include +#include "cassandra_types.h" namespace org { namespace apache { namespace cassandra { diff --git a/libgenthrift/cassandra_types.h b/libgenthrift/cassandra_types.h index 0e84217..8eb8c05 100644 --- a/libgenthrift/cassandra_types.h +++ b/libgenthrift/cassandra_types.h @@ -7,6 +7,7 @@ #define cassandra_TYPES_H #include +#include #include #include @@ -24,6 +25,7 @@ enum ConsistencyLevel { ANY = 6 }; + class Column { public: @@ -60,6 +62,7 @@ class Column { }; + class SuperColumn { public: @@ -93,6 +96,12 @@ class SuperColumn { }; +typedef struct _ColumnOrSuperColumn__isset { + _ColumnOrSuperColumn__isset() : column(false), super_column(false) {} + bool column; + bool super_column; +} _ColumnOrSuperColumn__isset; + class ColumnOrSuperColumn { public: @@ -107,11 +116,7 @@ class ColumnOrSuperColumn { Column column; SuperColumn super_column; - struct __isset { - __isset() : column(false), super_column(false) {} - bool column; - bool super_column; - } __isset; + _ColumnOrSuperColumn__isset __isset; bool operator == (const ColumnOrSuperColumn & rhs) const { @@ -136,6 +141,7 @@ class ColumnOrSuperColumn { }; + class NotFoundException : public ::apache::thrift::TException { public: @@ -163,6 +169,7 @@ class NotFoundException : public ::apache::thrift::TException { }; + class InvalidRequestException : public ::apache::thrift::TException { public: @@ -193,6 +200,7 @@ class InvalidRequestException : public ::apache::thrift::TException { }; + class UnavailableException : public ::apache::thrift::TException { public: @@ -220,6 +228,7 @@ class UnavailableException : public ::apache::thrift::TException { }; + class TimedOutException : public ::apache::thrift::TException { public: @@ -247,6 +256,7 @@ class TimedOutException : public ::apache::thrift::TException { }; + class AuthenticationException : public ::apache::thrift::TException { public: @@ -277,6 +287,7 @@ class AuthenticationException : public ::apache::thrift::TException { }; + class AuthorizationException : public ::apache::thrift::TException { public: @@ -307,6 +318,11 @@ class AuthorizationException : public ::apache::thrift::TException { }; +typedef struct _ColumnParent__isset { + _ColumnParent__isset() : super_column(false) {} + bool super_column; +} _ColumnParent__isset; + class ColumnParent { public: @@ -321,10 +337,7 @@ class ColumnParent { std::string column_family; std::string super_column; - struct __isset { - __isset() : super_column(false) {} - bool super_column; - } __isset; + _ColumnParent__isset __isset; bool operator == (const ColumnParent & rhs) const { @@ -347,6 +360,12 @@ class ColumnParent { }; +typedef struct _ColumnPath__isset { + _ColumnPath__isset() : super_column(false), column(false) {} + bool super_column; + bool column; +} _ColumnPath__isset; + class ColumnPath { public: @@ -362,11 +381,7 @@ class ColumnPath { std::string super_column; std::string column; - struct __isset { - __isset() : super_column(false), column(false) {} - bool super_column; - bool column; - } __isset; + _ColumnPath__isset __isset; bool operator == (const ColumnPath & rhs) const { @@ -393,6 +408,7 @@ class ColumnPath { }; + class SliceRange { public: @@ -432,6 +448,12 @@ class SliceRange { }; +typedef struct _SlicePredicate__isset { + _SlicePredicate__isset() : column_names(false), slice_range(false) {} + bool column_names; + bool slice_range; +} _SlicePredicate__isset; + class SlicePredicate { public: @@ -446,11 +468,7 @@ class SlicePredicate { std::vector column_names; SliceRange slice_range; - struct __isset { - __isset() : column_names(false), slice_range(false) {} - bool column_names; - bool slice_range; - } __isset; + _SlicePredicate__isset __isset; bool operator == (const SlicePredicate & rhs) const { @@ -475,6 +493,14 @@ class SlicePredicate { }; +typedef struct _KeyRange__isset { + _KeyRange__isset() : start_key(false), end_key(false), start_token(false), end_token(false) {} + bool start_key; + bool end_key; + bool start_token; + bool end_token; +} _KeyRange__isset; + class KeyRange { public: @@ -492,13 +518,7 @@ class KeyRange { std::string end_token; int32_t count; - struct __isset { - __isset() : start_key(false), end_key(false), start_token(false), end_token(false) {} - bool start_key; - bool end_key; - bool start_token; - bool end_token; - } __isset; + _KeyRange__isset __isset; bool operator == (const KeyRange & rhs) const { @@ -533,6 +553,7 @@ class KeyRange { }; + class KeySlice { public: @@ -566,6 +587,12 @@ class KeySlice { }; +typedef struct _Deletion__isset { + _Deletion__isset() : super_column(false), predicate(false) {} + bool super_column; + bool predicate; +} _Deletion__isset; + class Deletion { public: @@ -581,11 +608,7 @@ class Deletion { std::string super_column; SlicePredicate predicate; - struct __isset { - __isset() : super_column(false), predicate(false) {} - bool super_column; - bool predicate; - } __isset; + _Deletion__isset __isset; bool operator == (const Deletion & rhs) const { @@ -612,6 +635,12 @@ class Deletion { }; +typedef struct _Mutation__isset { + _Mutation__isset() : column_or_supercolumn(false), deletion(false) {} + bool column_or_supercolumn; + bool deletion; +} _Mutation__isset; + class Mutation { public: @@ -626,11 +655,7 @@ class Mutation { ColumnOrSuperColumn column_or_supercolumn; Deletion deletion; - struct __isset { - __isset() : column_or_supercolumn(false), deletion(false) {} - bool column_or_supercolumn; - bool deletion; - } __isset; + _Mutation__isset __isset; bool operator == (const Mutation & rhs) const { @@ -655,6 +680,7 @@ class Mutation { }; + class TokenRange { public: @@ -691,6 +717,7 @@ class TokenRange { }; + class AuthenticationRequest { public: From e5c7cf1b96836ec88ee78a844a666bbbd4a85810 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Fri, 27 Aug 2010 12:20:59 -0400 Subject: [PATCH 16/22] Unfortunately thrift-s output needs a bit of tweaking before it will compile --- libgenthrift/cassandra_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgenthrift/cassandra_constants.h b/libgenthrift/cassandra_constants.h index 7e121f4..84109a2 100644 --- a/libgenthrift/cassandra_constants.h +++ b/libgenthrift/cassandra_constants.h @@ -6,7 +6,7 @@ #ifndef cassandra_CONSTANTS_H #define cassandra_CONSTANTS_H -#include "cassandra_types.h" +#include namespace org { namespace apache { namespace cassandra { From 7fb71eaa8babb37ff55a26285cae5fcc22e9c0b0 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Mon, 28 Mar 2011 12:27:14 -0400 Subject: [PATCH 17/22] Re-implement commit 9465ae86de437b80625ffbf8db39570ef9d811bb after merging in 0.7 refactorization: Replace getSliceNames and getSliceRange with getColumns and getSuperColumns --- libcassandra/cassandra.cc | 187 +++++++++++++++++++++++++++++++++----- libcassandra/cassandra.h | 129 ++++++++++++++++++++++---- 2 files changed, 276 insertions(+), 40 deletions(-) diff --git a/libcassandra/cassandra.cc b/libcassandra/cassandra.cc index be8cc54..dc2d9bb 100644 --- a/libcassandra/cassandra.cc +++ b/libcassandra/cassandra.cc @@ -320,20 +320,34 @@ SuperColumn Cassandra::getSuperColumn(const string& key, return getSuperColumn(key, column_family, super_column_name, ConsistencyLevel::QUORUM); } - -vector Cassandra::getSliceNames(const string& key, - const ColumnParent& col_parent, - SlicePredicate& pred, - ConsistencyLevel::type level) +vector Cassandra::getColumns( + const string &key, + const string &column_family, + const string &super_column_name, + const vector column_names, + org::apache::cassandra::ConsistencyLevel::type level + ) { + + ColumnParent col_parent; + SlicePredicate pred; vector ret_cosc; vector result; - /* damn you thrift! */ + + col_parent.column_family.assign(column_family); + if (! super_column_name.empty()) + { + col_parent.super_column.assign(super_column_name); + col_parent.__isset.super_column= true; + } + + pred.column_names = column_names; pred.__isset.column_names= true; + thrift_client->get_slice(ret_cosc, key, col_parent, pred, level); for (vector::iterator it= ret_cosc.begin(); - it != ret_cosc.end(); - ++it) + it != ret_cosc.end(); + ++it) { if (! (*it).column.name.empty()) { @@ -343,28 +357,62 @@ vector Cassandra::getSliceNames(const string& key, return result; } +vector Cassandra::getColumns( + const string &key, + const string &column_family, + const string &super_column_name, + const vector column_names + ) +{ + return getColumns(key, column_family, super_column_name, column_names, ConsistencyLevel::QUORUM); +} -vector Cassandra::getSliceNames(const string& key, - const ColumnParent& col_parent, - SlicePredicate& pred) +vector Cassandra::getColumns( + const string &key, + const string &column_family, + const vector column_names, + org::apache::cassandra::ConsistencyLevel::type level + ) { - return getSliceNames(key, col_parent, pred, ConsistencyLevel::QUORUM); + return getColumns(key, column_family, "", column_names, level); } +vector Cassandra::getColumns( + const string &key, + const string &column_family, + const vector column_names + ) +{ + return getColumns(key, column_family, "", column_names, ConsistencyLevel::QUORUM); +} -vector Cassandra::getSliceRange(const string& key, - const ColumnParent& col_parent, - SlicePredicate& pred, - ConsistencyLevel::type level) +vector Cassandra::getColumns(const string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range, + org::apache::cassandra::ConsistencyLevel::type level + ) { + + ColumnParent col_parent; + SlicePredicate pred; vector ret_cosc; vector result; - /* damn you thrift! */ + + col_parent.column_family.assign(column_family); + if (! super_column_name.empty()) + { + col_parent.super_column.assign(super_column_name); + col_parent.__isset.super_column= true; + } + + pred.slice_range = range; pred.__isset.slice_range= true; + thrift_client->get_slice(ret_cosc, key, col_parent, pred, level); for (vector::iterator it= ret_cosc.begin(); - it != ret_cosc.end(); - ++it) + it != ret_cosc.end(); + ++it) { if (! (*it).column.name.empty()) { @@ -374,12 +422,105 @@ vector Cassandra::getSliceRange(const string& key, return result; } +vector Cassandra::getColumns(const string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range + ) +{ + return getColumns(key, column_family, super_column_name, range, ConsistencyLevel::QUORUM); +} + +vector Cassandra::getColumns(const string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range, + org::apache::cassandra::ConsistencyLevel::type level + ) +{ + return getColumns(key, column_family, "", range, level); +} + +vector Cassandra::getColumns(const string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range + ) +{ + return getColumns(key, column_family, "", range, ConsistencyLevel::QUORUM); +} + +vector Cassandra::getSuperColumns( + const string& key, + const string &column_family, + const vector super_column_names, + ConsistencyLevel::type level) +{ + ColumnParent col_parent; + SlicePredicate pred; + vector ret_cosc; + vector result; + + col_parent.column_family.assign(column_family); + + pred.column_names = super_column_names; + pred.__isset.column_names= true; + + thrift_client->get_slice(ret_cosc, key, col_parent, pred, level); + for (vector::iterator it= ret_cosc.begin(); + it != ret_cosc.end(); + ++it) + { + if (! (*it).super_column.name.empty()) + { + result.push_back((*it).super_column); + } + } + return result; +} + +vector Cassandra::getSuperColumns( + const string& key, + const string &column_family, + const vector super_column_names) +{ + return getSuperColumns(key, column_family, super_column_names, ConsistencyLevel::QUORUM); +} + +vector Cassandra::getSuperColumns( + const string& key, + const string& column_family, + const org::apache::cassandra::SliceRange &range, + ConsistencyLevel::type level) +{ + ColumnParent col_parent; + SlicePredicate pred; + vector ret_cosc; + vector result; + + col_parent.column_family.assign(column_family); + + pred.slice_range = range; + pred.__isset.slice_range= true; + + thrift_client->get_slice(ret_cosc, key, col_parent, pred, level); + for (vector::iterator it= ret_cosc.begin(); + it != ret_cosc.end(); + ++it) + { + if (! (*it).super_column.name.empty()) + { + result.push_back((*it).super_column); + } + } + return result; +} + -vector Cassandra::getSliceRange(const string& key, - const ColumnParent& col_parent, - SlicePredicate& pred) +vector Cassandra::getSuperColumns( + const string& key, + const string& column_family, + const org::apache::cassandra::SliceRange &range) { - return getSliceRange(key, col_parent, pred, ConsistencyLevel::QUORUM); + return getSuperColumns(key, column_family, range, ConsistencyLevel::QUORUM); } diff --git a/libcassandra/cassandra.h b/libcassandra/cassandra.h index deb37d4..c08a55f 100644 --- a/libcassandra/cassandra.h +++ b/libcassandra/cassandra.h @@ -296,23 +296,118 @@ class Cassandra const std::string& column_family, const std::string& super_column_name); - std::vector getSliceNames(const std::string& key, - const org::apache::cassandra::ColumnParent& col_parent, - org::apache::cassandra::SlicePredicate& pred, - org::apache::cassandra::ConsistencyLevel::type level); - - std::vector getSliceNames(const std::string& key, - const org::apache::cassandra::ColumnParent& col_parent, - org::apache::cassandra::SlicePredicate& pred); - - std::vector getSliceRange(const std::string& key, - const org::apache::cassandra::ColumnParent& col_parent, - org::apache::cassandra::SlicePredicate& pred, - org::apache::cassandra::ConsistencyLevel::type level); - - std::vector getSliceRange(const std::string& key, - const org::apache::cassandra::ColumnParent& col_parent, - org::apache::cassandra::SlicePredicate& pred); + /* + * Retrieve multiple columns by list of names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] super_column_name the super column name (optional) + * @param[in] column_names the list of column names + * @param[in] level Consistency level (optional) + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const std::vector column_names, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const std::vector column_names); + + /* + * Retrieve multiple columns by list of names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] column_names the list of column names + * @param[in] level Consistency level (optional) + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::vector column_names, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::vector column_names); + + /** + * Retrieve multiple columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] super_column_name the super column name (optional) + * @param[in] range the range for the query + * @param[in] level Consistency level (optional) + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getColumns(const std::string &key, + const std::string &column_family, + const std::string &super_column_name, + const org::apache::cassandra::SliceRange &range); + + /** + * Retrieve multiple columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] range the range for the query + * @param[in] level Consistency level (optional) + * @return A list of found columns + */ + std::vector getColumns(const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getColumns(const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range); + + + /** + * Retrieve multiple super columns by names + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] super_column_names the list of super column names + * @param[in] level Consistency level (optional) + * @return A list of found super columns + */ + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const std::vector super_column_names, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const std::vector super_column_names); + /** + * Retrieve multiple super columns by range + * + * @param[in] key the column key + * @param[in] column_family the column family + * @param[in] range the range for the query + * @param[in] level Consistency level (optional) + * @return A list of found super columns + */ + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range, + org::apache::cassandra::ConsistencyLevel::type level); + std::vector getSuperColumns( + const std::string &key, + const std::string &column_family, + const org::apache::cassandra::SliceRange &range); + std::map > getRangeSlice(const org::apache::cassandra::ColumnParent& col_parent, From e678083cbd317d48a4937cf63f5396ceb2a9362d Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Wed, 27 Oct 2010 11:39:20 -0400 Subject: [PATCH 18/22] Cherry-pick commits 71676d1ee136db887208183f9b5d687197c9d614 and 2e1291b70e1821d5df66c6487106ab7d27370726 from libcassie's branch: Implement connect/send/receive timeout support --- examples/simple.cc | 5 +++ libcassandra/cassandra.cc | 25 +++++++++++++++ libcassandra/cassandra.h | 4 +++ libcassandra/cassandra_factory.cc | 52 +++++++++++++++++++++++++------ libcassandra/cassandra_factory.h | 14 +++++++-- 5 files changed, 88 insertions(+), 12 deletions(-) diff --git a/examples/simple.cc b/examples/simple.cc index 0a59704..8c998ac 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -17,6 +17,7 @@ using namespace libcassandra; static string host("127.0.0.1"); static int port= 9160; +static int timeout= 5000; int main() { @@ -24,6 +25,10 @@ int main() CassandraFactory factory(host, port); tr1::shared_ptr client(factory.create()); + // Not really needed since the factory timeout sets all 3 by default: + client->setRecvTimeout(timeout); + client->setSendTimeout(timeout); + string clus_name= client->getClusterName(); cout << "cluster name: " << clus_name << endl; diff --git a/libcassandra/cassandra.cc b/libcassandra/cassandra.cc index dc2d9bb..2d97196 100644 --- a/libcassandra/cassandra.cc +++ b/libcassandra/cassandra.cc @@ -16,6 +16,8 @@ #include #include "libgenthrift/Cassandra.h" +#include +#include #include "libcassandra/cassandra.h" #include "libcassandra/exception.h" @@ -79,6 +81,29 @@ Cassandra::~Cassandra() delete thrift_client; } +void Cassandra::setRecvTimeout(int recv_timeout) { + + if (recv_timeout > 0) { + boost::shared_ptr t1 = thrift_client->getInputProtocol()->getTransport(); + boost::shared_ptr t2 = boost::dynamic_pointer_cast(t1); + boost::shared_ptr t3 = t2->getUnderlyingTransport(); + boost::shared_ptr s = boost::dynamic_pointer_cast(t3); + s->setRecvTimeout(recv_timeout); + } + +} + +void Cassandra::setSendTimeout(int send_timeout) { + + if (send_timeout > 0) { + boost::shared_ptr t1 = thrift_client->getOutputProtocol()->getTransport(); + boost::shared_ptr t2 = boost::dynamic_pointer_cast(t1); + boost::shared_ptr t3 = t2->getUnderlyingTransport(); + boost::shared_ptr s = boost::dynamic_pointer_cast(t3); + s->setSendTimeout(send_timeout); + } + +} CassandraClient *Cassandra::getCassandra() { diff --git a/libcassandra/cassandra.h b/libcassandra/cassandra.h index c08a55f..ba6c104 100644 --- a/libcassandra/cassandra.h +++ b/libcassandra/cassandra.h @@ -59,6 +59,10 @@ class Cassandra ON_FAIL_TRY_ALL_AVAILABLE /* try all available servers in cluster before return to user */ }; + void setRecvTimeout(int recv_timeout); + + void setSendTimeout(int send_timeout); + /** * @return the underlying cassandra thrift client. */ diff --git a/libcassandra/cassandra_factory.cc b/libcassandra/cassandra_factory.cc index 34af473..2c061bc 100644 --- a/libcassandra/cassandra_factory.cc +++ b/libcassandra/cassandra_factory.cc @@ -33,7 +33,10 @@ CassandraFactory::CassandraFactory(const string& server_list) : url(server_list), host(), - port(0) + port(0), + conn_timeout(-1), + recv_timeout(-1), + send_timeout(-1) { /* get the host name from the server list string */ string::size_type pos= server_list.find_first_of(':'); @@ -45,12 +48,14 @@ CassandraFactory::CassandraFactory(const string& server_list) int_stream >> port; } - CassandraFactory::CassandraFactory(const string& in_host, int in_port) : url(), host(in_host), - port(in_port) + port(in_port), + conn_timeout(-1), + recv_timeout(-1), + send_timeout(-1) { url.append(host); url.append(":"); @@ -59,13 +64,28 @@ CassandraFactory::CassandraFactory(const string& in_host, int in_port) url.append(port_str.str()); } +CassandraFactory::CassandraFactory(const string& in_host, int in_port, int in_timeout) + : + url(), + host(in_host), + port(in_port), + conn_timeout(in_timeout), + recv_timeout(in_timeout), + send_timeout(in_timeout) +{ + url.append(host); + url.append(":"); + ostringstream port_str; + port_str << port; + url.append(port_str.str()); +} CassandraFactory::~CassandraFactory() {} tr1::shared_ptr CassandraFactory::create() { - CassandraClient *thrift_client= createThriftClient(host, port); + CassandraClient *thrift_client= createThriftClient(host, port, conn_timeout, recv_timeout, send_timeout); tr1::shared_ptr ret(new Cassandra(thrift_client, host, port)); return ret; } @@ -73,17 +93,31 @@ tr1::shared_ptr CassandraFactory::create() tr1::shared_ptr CassandraFactory::create(const string& keyspace) { - CassandraClient *thrift_client= createThriftClient(host, port); + CassandraClient *thrift_client= createThriftClient(host, port, conn_timeout, recv_timeout, send_timeout); tr1::shared_ptr ret(new Cassandra(thrift_client, host, port, keyspace)); return ret; } -CassandraClient *CassandraFactory::createThriftClient(const string& in_host, - int in_port) +CassandraClient *CassandraFactory::createThriftClient(const string &in_host, + int in_port, + int in_conn_timeout, + int in_recv_timeout, + int in_send_timeout) { - boost::shared_ptr socket(new TSocket(in_host, in_port)); - boost::shared_ptr transport= boost::shared_ptr(new TFramedTransport(socket)); + boost::shared_ptr socket(new TSocket(in_host, in_port)); + + if (in_conn_timeout >= 0) { + socket->setConnTimeout(in_conn_timeout); + } + if (in_recv_timeout >= 0) { + socket->setRecvTimeout(in_recv_timeout); + } + if (in_send_timeout >= 0) { + socket->setSendTimeout(in_send_timeout); + } + + boost::shared_ptr transport = boost::shared_ptr(new TFramedTransport(socket)); boost::shared_ptr protocol(new TBinaryProtocol(transport)); CassandraClient *client= new(std::nothrow) CassandraClient(protocol); diff --git a/libcassandra/cassandra_factory.h b/libcassandra/cassandra_factory.h index 8a7f8d7..5a97050 100644 --- a/libcassandra/cassandra_factory.h +++ b/libcassandra/cassandra_factory.h @@ -39,6 +39,7 @@ class CassandraFactory CassandraFactory(const std::string& server_list); CassandraFactory(const std::string& in_host, int in_port); + CassandraFactory(const std::string& in_host, int in_port, int in_timeout); ~CassandraFactory(); /** @@ -69,14 +70,21 @@ class CassandraFactory private: - org::apache::cassandra::CassandraClient *createThriftClient(const std::string& host, - int port); - std::string url; + org::apache::cassandra::CassandraClient *createThriftClient(const std::string &host, + int port, + int conn_timeout, + int recv_timeout, + int send_timeout + ); + std::string host; int port; + int conn_timeout; + int recv_timeout; + int send_timeout; }; From 3de7beb95d2e8666650caf0d83af0eb5257b5c90 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Wed, 30 Mar 2011 11:01:31 -0400 Subject: [PATCH 19/22] Re-generate libgenthrift using thrift 0.6.0 --- README | 3 +- libgenthrift/Cassandra.cpp | 1078 ++++++++++++++++++++++------ libgenthrift/Cassandra.h | 62 +- libgenthrift/cassandra_constants.h | 2 +- libgenthrift/cassandra_types.cpp | 46 ++ libgenthrift/cassandra_types.h | 10 +- 6 files changed, 964 insertions(+), 237 deletions(-) diff --git a/README b/README index 68da668..0c2a5d8 100644 --- a/README +++ b/README @@ -6,7 +6,8 @@ the Java client hector. The master branch will follow along with Cassandra trunk. Branches corresponding to stable releases of Cassandra will be available. Downloads of these branches are also provided. -The current master and 0.7.0 branches will work with Apache Cassandra 0.7.x. +The current master and 0.7.0 branches will work with Apache Cassandra 0.7.x. . Internal libgenthrift +generated by thrift 0.6.0 == Install diff --git a/libgenthrift/Cassandra.cpp b/libgenthrift/Cassandra.cpp index c847d01..4b48359 100644 --- a/libgenthrift/Cassandra.cpp +++ b/libgenthrift/Cassandra.cpp @@ -6299,8 +6299,8 @@ void CassandraClient::send_login(const AuthenticationRequest& auth_request) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_login() @@ -6322,13 +6322,11 @@ void CassandraClient::recv_login() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("login") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_login_presult result; result.read(iprot_); @@ -6360,8 +6358,8 @@ void CassandraClient::send_set_keyspace(const std::string& keyspace) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_set_keyspace() @@ -6383,13 +6381,11 @@ void CassandraClient::recv_set_keyspace() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("set_keyspace") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_set_keyspace_presult result; result.read(iprot_); @@ -6420,8 +6416,8 @@ void CassandraClient::send_get(const std::string& key, const ColumnPath& column_ args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_get(ColumnOrSuperColumn& _return) @@ -6443,13 +6439,11 @@ void CassandraClient::recv_get(ColumnOrSuperColumn& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("get") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_get_presult result; result.success = &_return; @@ -6495,8 +6489,8 @@ void CassandraClient::send_get_slice(const std::string& key, const ColumnParent& args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_get_slice(std::vector & _return) @@ -6518,13 +6512,11 @@ void CassandraClient::recv_get_slice(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("get_slice") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_get_slice_presult result; result.success = &_return; @@ -6567,8 +6559,8 @@ void CassandraClient::send_get_count(const std::string& key, const ColumnParent& args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } int32_t CassandraClient::recv_get_count() @@ -6590,13 +6582,11 @@ int32_t CassandraClient::recv_get_count() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("get_count") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } int32_t _return; Cassandra_get_count_presult result; @@ -6639,8 +6629,8 @@ void CassandraClient::send_multiget_slice(const std::vector & keys, args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_multiget_slice(std::map > & _return) @@ -6662,13 +6652,11 @@ void CassandraClient::recv_multiget_slice(std::mapskip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("multiget_slice") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_multiget_slice_presult result; result.success = &_return; @@ -6711,8 +6699,8 @@ void CassandraClient::send_multiget_count(const std::vector & keys, args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_multiget_count(std::map & _return) @@ -6734,13 +6722,11 @@ void CassandraClient::recv_multiget_count(std::map & _retu iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("multiget_count") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_multiget_count_presult result; result.success = &_return; @@ -6783,8 +6769,8 @@ void CassandraClient::send_get_range_slices(const ColumnParent& column_parent, c args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_get_range_slices(std::vector & _return) @@ -6806,13 +6792,11 @@ void CassandraClient::recv_get_range_slices(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("get_range_slices") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_get_range_slices_presult result; result.success = &_return; @@ -6855,8 +6839,8 @@ void CassandraClient::send_get_indexed_slices(const ColumnParent& column_parent, args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_get_indexed_slices(std::vector & _return) @@ -6878,13 +6862,11 @@ void CassandraClient::recv_get_indexed_slices(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("get_indexed_slices") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_get_indexed_slices_presult result; result.success = &_return; @@ -6927,8 +6909,8 @@ void CassandraClient::send_insert(const std::string& key, const ColumnParent& co args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_insert() @@ -6950,13 +6932,11 @@ void CassandraClient::recv_insert() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("insert") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_insert_presult result; result.read(iprot_); @@ -6994,8 +6974,8 @@ void CassandraClient::send_remove(const std::string& key, const ColumnPath& colu args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_remove() @@ -7017,13 +6997,11 @@ void CassandraClient::recv_remove() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("remove") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_remove_presult result; result.read(iprot_); @@ -7059,8 +7037,8 @@ void CassandraClient::send_batch_mutate(const std::mapwriteMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_batch_mutate() @@ -7082,13 +7060,11 @@ void CassandraClient::recv_batch_mutate() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("batch_mutate") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_batch_mutate_presult result; result.read(iprot_); @@ -7123,8 +7099,8 @@ void CassandraClient::send_truncate(const std::string& cfname) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_truncate() @@ -7146,13 +7122,11 @@ void CassandraClient::recv_truncate() iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("truncate") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_truncate_presult result; result.read(iprot_); @@ -7183,8 +7157,8 @@ void CassandraClient::send_describe_schema_versions() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_schema_versions(std::map > & _return) @@ -7206,13 +7180,11 @@ void CassandraClient::recv_describe_schema_versions(std::mapskip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_schema_versions") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_schema_versions_presult result; result.success = &_return; @@ -7245,8 +7217,8 @@ void CassandraClient::send_describe_keyspaces() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_keyspaces(std::vector & _return) @@ -7268,13 +7240,11 @@ void CassandraClient::recv_describe_keyspaces(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_keyspaces") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_keyspaces_presult result; result.success = &_return; @@ -7307,8 +7277,8 @@ void CassandraClient::send_describe_cluster_name() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_cluster_name(std::string& _return) @@ -7330,13 +7300,11 @@ void CassandraClient::recv_describe_cluster_name(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_cluster_name") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_cluster_name_presult result; result.success = &_return; @@ -7366,8 +7334,8 @@ void CassandraClient::send_describe_version() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_version(std::string& _return) @@ -7389,13 +7357,11 @@ void CassandraClient::recv_describe_version(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_version") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_version_presult result; result.success = &_return; @@ -7426,8 +7392,8 @@ void CassandraClient::send_describe_ring(const std::string& keyspace) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_ring(std::vector & _return) @@ -7449,13 +7415,11 @@ void CassandraClient::recv_describe_ring(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_ring") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_ring_presult result; result.success = &_return; @@ -7488,8 +7452,8 @@ void CassandraClient::send_describe_partitioner() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_partitioner(std::string& _return) @@ -7511,13 +7475,11 @@ void CassandraClient::recv_describe_partitioner(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_partitioner") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_partitioner_presult result; result.success = &_return; @@ -7547,8 +7509,8 @@ void CassandraClient::send_describe_snitch() args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_snitch(std::string& _return) @@ -7570,13 +7532,11 @@ void CassandraClient::recv_describe_snitch(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_snitch") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_snitch_presult result; result.success = &_return; @@ -7607,8 +7567,8 @@ void CassandraClient::send_describe_keyspace(const std::string& keyspace) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_keyspace(KsDef& _return) @@ -7630,13 +7590,11 @@ void CassandraClient::recv_describe_keyspace(KsDef& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_keyspace") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_keyspace_presult result; result.success = &_return; @@ -7676,8 +7634,8 @@ void CassandraClient::send_describe_splits(const std::string& cfName, const std: args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_describe_splits(std::vector & _return) @@ -7699,13 +7657,11 @@ void CassandraClient::recv_describe_splits(std::vector & _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("describe_splits") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_describe_splits_presult result; result.success = &_return; @@ -7736,8 +7692,8 @@ void CassandraClient::send_system_add_column_family(const CfDef& cf_def) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_add_column_family(std::string& _return) @@ -7759,13 +7715,11 @@ void CassandraClient::recv_system_add_column_family(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_add_column_family") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_add_column_family_presult result; result.success = &_return; @@ -7799,8 +7753,8 @@ void CassandraClient::send_system_drop_column_family(const std::string& column_f args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_drop_column_family(std::string& _return) @@ -7822,13 +7776,11 @@ void CassandraClient::recv_system_drop_column_family(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_drop_column_family") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_drop_column_family_presult result; result.success = &_return; @@ -7862,8 +7814,8 @@ void CassandraClient::send_system_add_keyspace(const KsDef& ks_def) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_add_keyspace(std::string& _return) @@ -7885,13 +7837,11 @@ void CassandraClient::recv_system_add_keyspace(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_add_keyspace") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_add_keyspace_presult result; result.success = &_return; @@ -7925,8 +7875,8 @@ void CassandraClient::send_system_drop_keyspace(const std::string& keyspace) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_drop_keyspace(std::string& _return) @@ -7948,13 +7898,11 @@ void CassandraClient::recv_system_drop_keyspace(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_drop_keyspace") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_drop_keyspace_presult result; result.success = &_return; @@ -7988,8 +7936,8 @@ void CassandraClient::send_system_update_keyspace(const KsDef& ks_def) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_update_keyspace(std::string& _return) @@ -8011,13 +7959,11 @@ void CassandraClient::recv_system_update_keyspace(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_update_keyspace") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_update_keyspace_presult result; result.success = &_return; @@ -8051,8 +7997,8 @@ void CassandraClient::send_system_update_column_family(const CfDef& cf_def) args.write(oprot_); oprot_->writeMessageEnd(); - oprot_->getTransport()->flush(); oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); } void CassandraClient::recv_system_update_column_family(std::string& _return) @@ -8074,13 +8020,11 @@ void CassandraClient::recv_system_update_column_family(std::string& _return) iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); } if (fname.compare("system_update_column_family") != 0) { iprot_->skip(::apache::thrift::protocol::T_STRUCT); iprot_->readMessageEnd(); iprot_->getTransport()->readEnd(); - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::WRONG_METHOD_NAME); } Cassandra_system_update_column_family_presult result; result.success = &_return; @@ -8098,7 +8042,7 @@ void CassandraClient::recv_system_update_column_family(std::string& _return) throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_update_column_family failed: unknown result"); } -bool CassandraProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot) { +bool CassandraProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext) { ::apache::thrift::protocol::TProtocol* iprot = piprot.get(); ::apache::thrift::protocol::TProtocol* oprot = poprot.get(); @@ -8116,16 +8060,16 @@ bool CassandraProcessor::process(boost::shared_ptr< ::apache::thrift::protocol:: oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return true; } - return process_fn(iprot, oprot, fname, seqid); + return process_fn(iprot, oprot, fname, seqid, callContext); } -bool CassandraProcessor::process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid) { - std::map::iterator pfn; +bool CassandraProcessor::process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext) { + std::map::iterator pfn; pfn = processMap_.find(fname); if (pfn == processMap_.end()) { iprot->skip(::apache::thrift::protocol::T_STRUCT); @@ -8135,20 +8079,34 @@ bool CassandraProcessor::process_fn(::apache::thrift::protocol::TProtocol* iprot oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return true; } - (this->*(pfn->second))(seqid, iprot, oprot); + (this->*(pfn->second))(seqid, iprot, oprot, callContext); return true; } -void CassandraProcessor::process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.login", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.login"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.login"); + } + Cassandra_login_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.login", bytes); + } Cassandra_login_result result; try { @@ -8160,28 +8118,54 @@ void CassandraProcessor::process_login(int32_t seqid, ::apache::thrift::protocol result.authzx = authzx; result.__isset.authzx = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.login"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.login"); + } + oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.login", bytes); + } } -void CassandraProcessor::process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.set_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.set_keyspace"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.set_keyspace"); + } + Cassandra_set_keyspace_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.set_keyspace", bytes); + } Cassandra_set_keyspace_result result; try { @@ -8190,28 +8174,54 @@ void CassandraProcessor::process_set_keyspace(int32_t seqid, ::apache::thrift::p result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.set_keyspace"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.set_keyspace"); + } + oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.set_keyspace", bytes); + } } -void CassandraProcessor::process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.get", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.get"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.get"); + } + Cassandra_get_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.get", bytes); + } Cassandra_get_result result; try { @@ -8230,28 +8240,54 @@ void CassandraProcessor::process_get(int32_t seqid, ::apache::thrift::protocol:: result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.get"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.get"); + } + oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.get", bytes); + } } -void CassandraProcessor::process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.get_slice", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.get_slice"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.get_slice"); + } + Cassandra_get_slice_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.get_slice", bytes); + } Cassandra_get_slice_result result; try { @@ -8267,28 +8303,54 @@ void CassandraProcessor::process_get_slice(int32_t seqid, ::apache::thrift::prot result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.get_slice"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.get_slice"); + } + oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.get_slice", bytes); + } } -void CassandraProcessor::process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.get_count", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.get_count"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.get_count"); + } + Cassandra_get_count_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.get_count", bytes); + } Cassandra_get_count_result result; try { @@ -8304,28 +8366,54 @@ void CassandraProcessor::process_get_count(int32_t seqid, ::apache::thrift::prot result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.get_count"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.get_count"); + } + oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.get_count", bytes); + } } -void CassandraProcessor::process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.multiget_slice", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.multiget_slice"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.multiget_slice"); + } + Cassandra_multiget_slice_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.multiget_slice", bytes); + } Cassandra_multiget_slice_result result; try { @@ -8341,28 +8429,54 @@ void CassandraProcessor::process_multiget_slice(int32_t seqid, ::apache::thrift: result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.multiget_slice"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.multiget_slice"); + } + oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.multiget_slice", bytes); + } } -void CassandraProcessor::process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.multiget_count", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.multiget_count"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.multiget_count"); + } + Cassandra_multiget_count_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.multiget_count", bytes); + } Cassandra_multiget_count_result result; try { @@ -8378,28 +8492,54 @@ void CassandraProcessor::process_multiget_count(int32_t seqid, ::apache::thrift: result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.multiget_count"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.multiget_count"); + } + oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.multiget_count", bytes); + } } -void CassandraProcessor::process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.get_range_slices", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.get_range_slices"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.get_range_slices"); + } + Cassandra_get_range_slices_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.get_range_slices", bytes); + } Cassandra_get_range_slices_result result; try { @@ -8415,28 +8555,54 @@ void CassandraProcessor::process_get_range_slices(int32_t seqid, ::apache::thrif result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.get_range_slices"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.get_range_slices"); + } + oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.get_range_slices", bytes); + } } -void CassandraProcessor::process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.get_indexed_slices", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.get_indexed_slices"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.get_indexed_slices"); + } + Cassandra_get_indexed_slices_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.get_indexed_slices", bytes); + } Cassandra_get_indexed_slices_result result; try { @@ -8452,28 +8618,54 @@ void CassandraProcessor::process_get_indexed_slices(int32_t seqid, ::apache::thr result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.get_indexed_slices"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.get_indexed_slices"); + } + oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.get_indexed_slices", bytes); + } } -void CassandraProcessor::process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.insert", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.insert"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.insert"); + } + Cassandra_insert_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.insert", bytes); + } Cassandra_insert_result result; try { @@ -8488,28 +8680,54 @@ void CassandraProcessor::process_insert(int32_t seqid, ::apache::thrift::protoco result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.insert"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.insert"); + } + oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.insert", bytes); + } } -void CassandraProcessor::process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.remove", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.remove"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.remove"); + } + Cassandra_remove_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.remove", bytes); + } Cassandra_remove_result result; try { @@ -8524,28 +8742,54 @@ void CassandraProcessor::process_remove(int32_t seqid, ::apache::thrift::protoco result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.remove"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.remove"); + } + oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.remove", bytes); + } } -void CassandraProcessor::process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.batch_mutate", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.batch_mutate"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.batch_mutate"); + } + Cassandra_batch_mutate_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.batch_mutate", bytes); + } Cassandra_batch_mutate_result result; try { @@ -8560,28 +8804,54 @@ void CassandraProcessor::process_batch_mutate(int32_t seqid, ::apache::thrift::p result.te = te; result.__isset.te = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.batch_mutate"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.batch_mutate"); + } + oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.batch_mutate", bytes); + } } -void CassandraProcessor::process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.truncate", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.truncate"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.truncate"); + } + Cassandra_truncate_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.truncate", bytes); + } Cassandra_truncate_result result; try { @@ -8593,28 +8863,54 @@ void CassandraProcessor::process_truncate(int32_t seqid, ::apache::thrift::proto result.ue = ue; result.__isset.ue = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.truncate"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.truncate"); + } + oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.truncate", bytes); + } } -void CassandraProcessor::process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_schema_versions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_schema_versions"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_schema_versions"); + } + Cassandra_describe_schema_versions_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_schema_versions", bytes); + } Cassandra_describe_schema_versions_result result; try { @@ -8624,28 +8920,54 @@ void CassandraProcessor::process_describe_schema_versions(int32_t seqid, ::apach result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_schema_versions"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_schema_versions"); + } + oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_schema_versions", bytes); + } } -void CassandraProcessor::process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_keyspaces", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_keyspaces"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_keyspaces"); + } + Cassandra_describe_keyspaces_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_keyspaces", bytes); + } Cassandra_describe_keyspaces_result result; try { @@ -8655,84 +8977,162 @@ void CassandraProcessor::process_describe_keyspaces(int32_t seqid, ::apache::thr result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_keyspaces"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_keyspaces"); + } + oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_keyspaces", bytes); + } } -void CassandraProcessor::process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_cluster_name", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_cluster_name"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_cluster_name"); + } + Cassandra_describe_cluster_name_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_cluster_name", bytes); + } Cassandra_describe_cluster_name_result result; try { iface_->describe_cluster_name(result.success); result.__isset.success = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_cluster_name"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_cluster_name"); + } + oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_cluster_name", bytes); + } } -void CassandraProcessor::process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_version"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_version"); + } + Cassandra_describe_version_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_version", bytes); + } Cassandra_describe_version_result result; try { iface_->describe_version(result.success); result.__isset.success = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_version"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_version"); + } + oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_version", bytes); + } } -void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_ring", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_ring"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_ring"); + } + Cassandra_describe_ring_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_ring", bytes); + } Cassandra_describe_ring_result result; try { @@ -8742,84 +9142,162 @@ void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift:: result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_ring"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_ring"); + } + oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_ring", bytes); + } } -void CassandraProcessor::process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_partitioner", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_partitioner"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_partitioner"); + } + Cassandra_describe_partitioner_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_partitioner", bytes); + } Cassandra_describe_partitioner_result result; try { iface_->describe_partitioner(result.success); result.__isset.success = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_partitioner"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_partitioner"); + } + oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_partitioner", bytes); + } } -void CassandraProcessor::process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_snitch", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_snitch"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_snitch"); + } + Cassandra_describe_snitch_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_snitch", bytes); + } Cassandra_describe_snitch_result result; try { iface_->describe_snitch(result.success); result.__isset.success = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_snitch"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_snitch"); + } + oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_snitch", bytes); + } } -void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_keyspace"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_keyspace"); + } + Cassandra_describe_keyspace_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_keyspace", bytes); + } Cassandra_describe_keyspace_result result; try { @@ -8832,56 +9310,108 @@ void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thri result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_keyspace"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_keyspace"); + } + oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_keyspace", bytes); + } } -void CassandraProcessor::process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.describe_splits", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.describe_splits"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.describe_splits"); + } + Cassandra_describe_splits_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.describe_splits", bytes); + } Cassandra_describe_splits_result result; try { iface_->describe_splits(result.success, args.cfName, args.start_token, args.end_token, args.keys_per_split); result.__isset.success = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.describe_splits"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.describe_splits"); + } + oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.describe_splits", bytes); + } } -void CassandraProcessor::process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_add_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_add_column_family"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_add_column_family"); + } + Cassandra_system_add_column_family_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_add_column_family", bytes); + } Cassandra_system_add_column_family_result result; try { @@ -8891,28 +9421,54 @@ void CassandraProcessor::process_system_add_column_family(int32_t seqid, ::apach result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_add_column_family"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_add_column_family"); + } + oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_add_column_family", bytes); + } } -void CassandraProcessor::process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_drop_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_drop_column_family"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_drop_column_family"); + } + Cassandra_system_drop_column_family_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_drop_column_family", bytes); + } Cassandra_system_drop_column_family_result result; try { @@ -8922,28 +9478,54 @@ void CassandraProcessor::process_system_drop_column_family(int32_t seqid, ::apac result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_drop_column_family"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_drop_column_family"); + } + oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_drop_column_family", bytes); + } } -void CassandraProcessor::process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_add_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_add_keyspace"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_add_keyspace"); + } + Cassandra_system_add_keyspace_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_add_keyspace", bytes); + } Cassandra_system_add_keyspace_result result; try { @@ -8953,28 +9535,54 @@ void CassandraProcessor::process_system_add_keyspace(int32_t seqid, ::apache::th result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_add_keyspace"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_add_keyspace"); + } + oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_add_keyspace", bytes); + } } -void CassandraProcessor::process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_drop_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_drop_keyspace"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_drop_keyspace"); + } + Cassandra_system_drop_keyspace_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_drop_keyspace", bytes); + } Cassandra_system_drop_keyspace_result result; try { @@ -8984,28 +9592,54 @@ void CassandraProcessor::process_system_drop_keyspace(int32_t seqid, ::apache::t result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_drop_keyspace"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_drop_keyspace"); + } + oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_drop_keyspace", bytes); + } } -void CassandraProcessor::process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_update_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_update_keyspace"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_update_keyspace"); + } + Cassandra_system_update_keyspace_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_update_keyspace", bytes); + } Cassandra_system_update_keyspace_result result; try { @@ -9015,28 +9649,54 @@ void CassandraProcessor::process_system_update_keyspace(int32_t seqid, ::apache: result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_update_keyspace"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_update_keyspace"); + } + oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_update_keyspace", bytes); + } } -void CassandraProcessor::process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot) +void CassandraProcessor::process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { + void* ctx = NULL; + if (eventHandler_.get() != NULL) { + ctx = eventHandler_->getContext("Cassandra.system_update_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "Cassandra.system_update_column_family"); + + if (eventHandler_.get() != NULL) { + eventHandler_->preRead(ctx, "Cassandra.system_update_column_family"); + } + Cassandra_system_update_column_family_args args; args.read(iprot); iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postRead(ctx, "Cassandra.system_update_column_family", bytes); + } Cassandra_system_update_column_family_result result; try { @@ -9046,20 +9706,32 @@ void CassandraProcessor::process_system_update_column_family(int32_t seqid, ::ap result.ire = ire; result.__isset.ire = true; } catch (const std::exception& e) { + if (eventHandler_.get() != NULL) { + eventHandler_->handlerError(ctx, "Cassandra.system_update_column_family"); + } + ::apache::thrift::TApplicationException x(e.what()); oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); x.write(oprot); oprot->writeMessageEnd(); - oprot->getTransport()->flush(); oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); return; } + if (eventHandler_.get() != NULL) { + eventHandler_->preWrite(ctx, "Cassandra.system_update_column_family"); + } + oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_REPLY, seqid); result.write(oprot); oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); oprot->getTransport()->flush(); - oprot->getTransport()->writeEnd(); + + if (eventHandler_.get() != NULL) { + eventHandler_->postWrite(ctx, "Cassandra.system_update_column_family", bytes); + } } }}} // namespace diff --git a/libgenthrift/Cassandra.h b/libgenthrift/Cassandra.h index b75e338..6eb0850 100644 --- a/libgenthrift/Cassandra.h +++ b/libgenthrift/Cassandra.h @@ -3248,37 +3248,37 @@ class CassandraClient : virtual public CassandraIf { class CassandraProcessor : virtual public ::apache::thrift::TProcessor { protected: boost::shared_ptr iface_; - virtual bool process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid); + virtual bool process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext); private: - std::map processMap_; - void process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); - void process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot); + std::map processMap_; + void process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); public: CassandraProcessor(boost::shared_ptr iface) : iface_(iface) { @@ -3312,7 +3312,7 @@ class CassandraProcessor : virtual public ::apache::thrift::TProcessor { processMap_["system_update_column_family"] = &CassandraProcessor::process_system_update_column_family; } - virtual bool process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot); + virtual bool process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext); virtual ~CassandraProcessor() {} }; diff --git a/libgenthrift/cassandra_constants.h b/libgenthrift/cassandra_constants.h index 84109a2..7e121f4 100644 --- a/libgenthrift/cassandra_constants.h +++ b/libgenthrift/cassandra_constants.h @@ -6,7 +6,7 @@ #ifndef cassandra_CONSTANTS_H #define cassandra_CONSTANTS_H -#include +#include "cassandra_types.h" namespace org { namespace apache { namespace cassandra { diff --git a/libgenthrift/cassandra_types.cpp b/libgenthrift/cassandra_types.cpp index 7120971..9637711 100644 --- a/libgenthrift/cassandra_types.cpp +++ b/libgenthrift/cassandra_types.cpp @@ -7,6 +7,52 @@ namespace org { namespace apache { namespace cassandra { +int _kConsistencyLevelValues[] = { + ConsistencyLevel::ONE, + ConsistencyLevel::QUORUM, + ConsistencyLevel::LOCAL_QUORUM, + ConsistencyLevel::EACH_QUORUM, + ConsistencyLevel::ALL, + ConsistencyLevel::ANY, + ConsistencyLevel::TWO, + ConsistencyLevel::THREE +}; +const char* _kConsistencyLevelNames[] = { + "ONE", + "QUORUM", + "LOCAL_QUORUM", + "EACH_QUORUM", + "ALL", + "ANY", + "TWO", + "THREE" +}; +const std::map _ConsistencyLevel_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kConsistencyLevelValues, _kConsistencyLevelNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kIndexOperatorValues[] = { + IndexOperator::EQ, + IndexOperator::GTE, + IndexOperator::GT, + IndexOperator::LTE, + IndexOperator::LT +}; +const char* _kIndexOperatorNames[] = { + "EQ", + "GTE", + "GT", + "LTE", + "LT" +}; +const std::map _IndexOperator_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kIndexOperatorValues, _kIndexOperatorNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kIndexTypeValues[] = { + IndexType::KEYS +}; +const char* _kIndexTypeNames[] = { + "KEYS" +}; +const std::map _IndexType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kIndexTypeValues, _kIndexTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + const char* Column::ascii_fingerprint = "AFF5A2690BB9979816507B2F6BD21062"; const uint8_t Column::binary_fingerprint[16] = {0xAF,0xF5,0xA2,0x69,0x0B,0xB9,0x97,0x98,0x16,0x50,0x7B,0x2F,0x6B,0xD2,0x10,0x62}; diff --git a/libgenthrift/cassandra_types.h b/libgenthrift/cassandra_types.h index 563449a..b2ce096 100644 --- a/libgenthrift/cassandra_types.h +++ b/libgenthrift/cassandra_types.h @@ -22,10 +22,14 @@ struct ConsistencyLevel { LOCAL_QUORUM = 3, EACH_QUORUM = 4, ALL = 5, - ANY = 6 + ANY = 6, + TWO = 7, + THREE = 8 }; }; +extern const std::map _ConsistencyLevel_VALUES_TO_NAMES; + struct IndexOperator { enum type { EQ = 0, @@ -36,12 +40,16 @@ struct IndexOperator { }; }; +extern const std::map _IndexOperator_VALUES_TO_NAMES; + struct IndexType { enum type { KEYS = 0 }; }; +extern const std::map _IndexType_VALUES_TO_NAMES; + typedef struct _Column__isset { _Column__isset() : ttl(false) {} bool ttl; From c970110ea27f76e4855a430f7b45b204d1147d94 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Wed, 30 Mar 2011 11:01:55 -0400 Subject: [PATCH 20/22] Usual fix after libgenthrift update to make compiling work again --- libgenthrift/cassandra_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgenthrift/cassandra_constants.h b/libgenthrift/cassandra_constants.h index 7e121f4..84109a2 100644 --- a/libgenthrift/cassandra_constants.h +++ b/libgenthrift/cassandra_constants.h @@ -6,7 +6,7 @@ #ifndef cassandra_CONSTANTS_H #define cassandra_CONSTANTS_H -#include "cassandra_types.h" +#include namespace org { namespace apache { namespace cassandra { From cb68df9eddf50d5ad68436d1ab744a7ffd679793 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Fri, 1 Apr 2011 14:57:30 -0400 Subject: [PATCH 21/22] Fix memleak if socket opening fails during construction as reported in https://github.com/posulliv/libcassandra/issues/#issue/9 --- libcassandra/cassandra_factory.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcassandra/cassandra_factory.cc b/libcassandra/cassandra_factory.cc index 2c061bc..5323072 100644 --- a/libcassandra/cassandra_factory.cc +++ b/libcassandra/cassandra_factory.cc @@ -119,10 +119,10 @@ CassandraClient *CassandraFactory::createThriftClient(const string &in_host, boost::shared_ptr transport = boost::shared_ptr(new TFramedTransport(socket)); boost::shared_ptr protocol(new TBinaryProtocol(transport)); - CassandraClient *client= new(std::nothrow) CassandraClient(protocol); - transport->open(); /* throws an exception */ + CassandraClient *client= new(std::nothrow) CassandraClient(protocol); + return client; } From dbc365e2f1cf5584eaba418abd498a800ba9c748 Mon Sep 17 00:00:00 2001 From: Mina Naguib Date: Tue, 11 Apr 2017 16:34:41 -0400 Subject: [PATCH 22/22] Update README --- README | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README b/README index 0c2a5d8..6a92735 100644 --- a/README +++ b/README @@ -1,3 +1,14 @@ +== End-Of-Life notice + +This driver did its job at the time, but since has been greatly superceded by: +https://github.com/datastax/cpp-driver + +Please switch to the above. + + + +Original README: + == libcassandra A C++ wrapper library for the interface to cassandra generated by thrift. This library is based on