Permalink
Browse files

Update with latest Thrift (for real) and add keyspace and cf wrapper …

…classes.
  • Loading branch information...
1 parent d92b665 commit 3fd5c59b27f87690ea9f1d93fd84161d1429633e @b b committed Jun 6, 2010
Showing with 48 additions and 4 deletions.
  1. +3 −0 Manifest
  2. +1 −1 Rakefile
  3. +3 −3 cassandra.gemspec
  4. +2 −0 lib/cassandra.rb
  5. +33 −0 lib/cassandra/cassandra.rb
  6. +3 −0 lib/cassandra/column_family.rb
  7. +3 −0 lib/cassandra/keyspace.rb
View
@@ -10,11 +10,13 @@ conf/storage-conf.xml
lib/cassandra.rb
lib/cassandra/array.rb
lib/cassandra/cassandra.rb
+lib/cassandra/column_family.rb
lib/cassandra/columns.rb
lib/cassandra/comparable.rb
lib/cassandra/constants.rb
lib/cassandra/debug.rb
lib/cassandra/helpers.rb
+lib/cassandra/keyspace.rb
lib/cassandra/long.rb
lib/cassandra/mock.rb
lib/cassandra/ordered_hash.rb
@@ -24,6 +26,7 @@ test/cassandra_client_test.rb
test/cassandra_mock_test.rb
test/cassandra_test.rb
test/comparable_types_test.rb
+test/eventmachine_test.rb
test/ordered_hash_test.rb
test/test_helper.rb
vendor/gen-rb/cassandra.rb
View
@@ -75,5 +75,5 @@ task :thrift do
system(
"cd vendor &&
rm -rf gen-rb &&
- thrift -gen rb #{CASSANDRA_HOME}/server/interface/cassandra.thrift")
+ thrift -gen rb #{CASSANDRA_HOME}/interface/cassandra.thrift")
end
View
@@ -6,13 +6,13 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
s.authors = ["Evan Weaver, Ryan King"]
- s.date = %q{2010-04-13}
+ s.date = %q{2010-06-05}
s.default_executable = %q{cassandra_helper}
s.description = %q{A Ruby client for the Cassandra distributed database.}
s.email = %q{}
s.executables = ["cassandra_helper"]
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "bin/cassandra_helper", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb"]
- s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "bin/cassandra_helper", "conf/cassandra.in.sh", "conf/log4j.properties", "conf/storage-conf.xml", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb", "test/cassandra_client_test.rb", "test/cassandra_mock_test.rb", "test/cassandra_test.rb", "test/comparable_types_test.rb", "test/ordered_hash_test.rb", "test/test_helper.rb", "vendor/gen-rb/cassandra.rb", "vendor/gen-rb/cassandra_constants.rb", "vendor/gen-rb/cassandra_types.rb", "cassandra.gemspec", "test/eventmachine_test.rb"]
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "bin/cassandra_helper", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/column_family.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/keyspace.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb"]
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "bin/cassandra_helper", "conf/cassandra.in.sh", "conf/log4j.properties", "conf/storage-conf.xml", "lib/cassandra.rb", "lib/cassandra/array.rb", "lib/cassandra/cassandra.rb", "lib/cassandra/column_family.rb", "lib/cassandra/columns.rb", "lib/cassandra/comparable.rb", "lib/cassandra/constants.rb", "lib/cassandra/debug.rb", "lib/cassandra/helpers.rb", "lib/cassandra/keyspace.rb", "lib/cassandra/long.rb", "lib/cassandra/mock.rb", "lib/cassandra/ordered_hash.rb", "lib/cassandra/protocol.rb", "lib/cassandra/time.rb", "test/cassandra_client_test.rb", "test/cassandra_mock_test.rb", "test/cassandra_test.rb", "test/comparable_types_test.rb", "test/eventmachine_test.rb", "test/ordered_hash_test.rb", "test/test_helper.rb", "vendor/gen-rb/cassandra.rb", "vendor/gen-rb/cassandra_constants.rb", "vendor/gen-rb/cassandra_types.rb", "cassandra.gemspec"]
s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/cassandra/}
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cassandra", "--main", "README.rdoc"]
s.require_paths = ["lib"]
View
@@ -19,4 +19,6 @@
require 'cassandra/protocol'
require 'cassandra/cassandra'
require 'cassandra/constants'
+require 'cassandra/column_family'
+require 'cassandra/keyspace'
require 'cassandra/debug' if ENV['DEBUG']
@@ -261,6 +261,39 @@ def batch(options = {})
@batch = nil
end
+ def add_column_family(cf)
+ if (res = @client.system_add_column_family(@keyspace, cf.cf_def))
+ @schema = nil
+ end
+ res
+ end
+
+ def drop_column_family(cf_name)
+ if (res = @client.system_drop_column_family(@keyspace, cf_name))
+ @schema = nil
+ end
+ res
+ end
+
+ def rename_column_family(old_name, new_name)
+ if (res = @client.system_rename_column_family(old_name, new_name))
+ @schema = nil
+ end
+ res
+ end
+
+ def self.add_keyspace(ks)
+ ; # CassandraThrift::Cassandra::Client.system_add_keyspace(ks)
+ end
+
+ def self.drop_keyspace(keyspace)
+ ; # CassandraThrift::Cassandra::Client.system_drop_keyspace(keyspace)
+ end
+
+ def self.rename_keyspace(old_name, new_name)
+ ; # CassandraThrift::Cassandra::Client.system_rename_keyspace(old_name, new_name)
+ end
+
protected
def calling_method
@@ -0,0 +1,3 @@
+class Cassandra
+ class ColumnFamily < CassandraThrift::CfDef ; end
+end
@@ -0,0 +1,3 @@
+class Cassandra
+ class Keyspace < CassandraThrift::KsDef ; end
+end

0 comments on commit 3fd5c59

Please sign in to comment.