Skip to content

Commit

Permalink
Merge branch 'master' into composite_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Mueller committed Feb 23, 2012
2 parents 1614686 + b703b50 commit c675857
Show file tree
Hide file tree
Showing 28 changed files with 3,899 additions and 99 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pkg
.redcar
doc/
.yardoc/
Gemfile.lock
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v0.12.2
- Respect the start_key in get_range. Resolves Issue #127.
- Fix issue with differences in gemspec and what is required. Resolves Issue #125.
- Update to Cassandra 0.8.7 and 1.0.2.

v0.12.1
- Fix issue with simple_uuid dependency.
- Fix issue with get_range & get_range_batch keeping all results when a block is given. Resolves Issue# 112.
Expand Down
39 changes: 0 additions & 39 deletions Gemfile.lock

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cassandra
A Ruby client for the Cassandra distributed database.

Supports 1.8.7, 1.9.2, and rubinius on Cassandra 0.6.13, 0.7.8, 0.8.4.
Supports 1.8.7, 1.9.2, and rubinius on Cassandra 0.6.13, 0.7.9, 0.8.6, 1.0.0-rc2.

## Getting Started

Expand Down Expand Up @@ -31,10 +31,10 @@ To use the default version simply use a normal require:

require 'cassandra'

To use a specific version (0.7 in this example) you would use a
To use a specific version (1.0 in this example) you would use a
slightly differently formatted require:

require 'cassandra/0.7'
require 'cassandra/1.0'

#### Environment Variable Method
These mechanisms work well when you are using the cassandra gem in your
Expand Down
13 changes: 8 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ unless ENV['FROM_BIN_CASSANDRA_HELPER']
p.project = "fauna"
p.summary = "A Ruby client for the Cassandra distributed database."
p.rubygems_version = ">= 0.8"
p.dependencies = ['thrift_client >=0.7.0', 'json', 'rake', 'simple_uuid >=0.2.0']
p.dependencies = ['thrift_client >=0.7.0 <0.9', 'json', 'rake', 'simple_uuid ~>0.2.0']
p.ignore_pattern = /^(data|vendor\/cassandra|cassandra|vendor\/thrift|.*\.rbc)/
p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
p.retain_gemspec = true
Expand All @@ -18,8 +18,9 @@ end

CassandraBinaries = {
'0.6' => 'http://archive.apache.org/dist/cassandra/0.6.13/apache-cassandra-0.6.13-bin.tar.gz',
'0.7' => 'http://archive.apache.org/dist/cassandra/0.7.8/apache-cassandra-0.7.8-bin.tar.gz',
'0.8' => 'http://archive.apache.org/dist/cassandra/0.8.4/apache-cassandra-0.8.4-bin.tar.gz'
'0.7' => 'http://archive.apache.org/dist/cassandra/0.7.9/apache-cassandra-0.7.9-bin.tar.gz',
'0.8' => 'http://archive.apache.org/dist/cassandra/0.8.7/apache-cassandra-0.8.7-bin.tar.gz',
'1.0' => 'http://archive.apache.org/dist/cassandra/1.0.6/apache-cassandra-1.0.6-bin.tar.gz'
}

CASSANDRA_HOME = ENV['CASSANDRA_HOME'] || "#{ENV['HOME']}/cassandra"
Expand Down Expand Up @@ -153,10 +154,12 @@ task :test => 'data:load'
# desc "Regenerate thrift bindings for Cassandra" # Dev only
task :thrift do
puts "Generating Thrift bindings"
FileUtils.mkdir_p "vendor/#{CASSANDRA_VERSION}"

system(
"cd vendor &&
"cd vendor/#{CASSANDRA_VERSION} &&
rm -rf gen-rb &&
thrift -gen rb #{CASSANDRA_HOME}/interface/cassandra.thrift")
thrift -gen rb #{File.join(CASSANDRA_HOME, "cassandra-#{CASSANDRA_VERSION}")}/interface/cassandra.thrift")
end

task :fix_perms do
Expand Down
44 changes: 22 additions & 22 deletions cassandra.gemspec
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{cassandra}
s.version = "0.12.1"
s.name = "cassandra"
s.version = "0.12.2"

s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Evan Weaver, Ryan King}]
s.date = %q{2011-08-22}
s.description = %q{A Ruby client for the Cassandra distributed database.}
s.email = %q{}
s.executables = [%q{cassandra_helper}]
s.extra_rdoc_files = [%q{CHANGELOG}, %q{LICENSE}, %q{README.md}, %q{bin/cassandra_helper}, %q{lib/cassandra.rb}, %q{lib/cassandra/0.6.rb}, %q{lib/cassandra/0.6/cassandra.rb}, %q{lib/cassandra/0.6/columns.rb}, %q{lib/cassandra/0.6/protocol.rb}, %q{lib/cassandra/0.7.rb}, %q{lib/cassandra/0.7/cassandra.rb}, %q{lib/cassandra/0.7/columns.rb}, %q{lib/cassandra/0.7/protocol.rb}, %q{lib/cassandra/0.8.rb}, %q{lib/cassandra/0.8/cassandra.rb}, %q{lib/cassandra/0.8/columns.rb}, %q{lib/cassandra/0.8/protocol.rb}, %q{lib/cassandra/array.rb}, %q{lib/cassandra/cassandra.rb}, %q{lib/cassandra/column_family.rb}, %q{lib/cassandra/columns.rb}, %q{lib/cassandra/comparable.rb}, %q{lib/cassandra/constants.rb}, %q{lib/cassandra/debug.rb}, %q{lib/cassandra/helpers.rb}, %q{lib/cassandra/keyspace.rb}, %q{lib/cassandra/long.rb}, %q{lib/cassandra/mock.rb}, %q{lib/cassandra/ordered_hash.rb}, %q{lib/cassandra/protocol.rb}, %q{lib/cassandra/time.rb}]
s.files = [%q{CHANGELOG}, %q{LICENSE}, %q{Manifest}, %q{README.md}, %q{Rakefile}, %q{bin/cassandra_helper}, %q{conf/0.6/cassandra.in.sh}, %q{conf/0.6/log4j.properties}, %q{conf/0.6/schema.json}, %q{conf/0.6/storage-conf.xml}, %q{conf/0.7/cassandra.in.sh}, %q{conf/0.7/cassandra.yaml}, %q{conf/0.7/log4j-server.properties}, %q{conf/0.7/schema.json}, %q{conf/0.7/schema.txt}, %q{conf/0.8/cassandra.in.sh}, %q{conf/0.8/cassandra.yaml}, %q{conf/0.8/log4j-server.properties}, %q{conf/0.8/schema.json}, %q{conf/0.8/schema.txt}, %q{lib/cassandra.rb}, %q{lib/cassandra/0.6.rb}, %q{lib/cassandra/0.6/cassandra.rb}, %q{lib/cassandra/0.6/columns.rb}, %q{lib/cassandra/0.6/protocol.rb}, %q{lib/cassandra/0.7.rb}, %q{lib/cassandra/0.7/cassandra.rb}, %q{lib/cassandra/0.7/columns.rb}, %q{lib/cassandra/0.7/protocol.rb}, %q{lib/cassandra/0.8.rb}, %q{lib/cassandra/0.8/cassandra.rb}, %q{lib/cassandra/0.8/columns.rb}, %q{lib/cassandra/0.8/protocol.rb}, %q{lib/cassandra/array.rb}, %q{lib/cassandra/cassandra.rb}, %q{lib/cassandra/column_family.rb}, %q{lib/cassandra/columns.rb}, %q{lib/cassandra/comparable.rb}, %q{lib/cassandra/constants.rb}, %q{lib/cassandra/debug.rb}, %q{lib/cassandra/helpers.rb}, %q{lib/cassandra/keyspace.rb}, %q{lib/cassandra/long.rb}, %q{lib/cassandra/mock.rb}, %q{lib/cassandra/ordered_hash.rb}, %q{lib/cassandra/protocol.rb}, %q{lib/cassandra/time.rb}, %q{test/cassandra_client_test.rb}, %q{test/cassandra_mock_test.rb}, %q{test/cassandra_test.rb}, %q{test/comparable_types_test.rb}, %q{test/eventmachine_test.rb}, %q{test/ordered_hash_test.rb}, %q{test/test_helper.rb}, %q{vendor/0.6/gen-rb/cassandra.rb}, %q{vendor/0.6/gen-rb/cassandra_constants.rb}, %q{vendor/0.6/gen-rb/cassandra_types.rb}, %q{vendor/0.7/gen-rb/cassandra.rb}, %q{vendor/0.7/gen-rb/cassandra_constants.rb}, %q{vendor/0.7/gen-rb/cassandra_types.rb}, %q{vendor/0.8/gen-rb/cassandra.rb}, %q{vendor/0.8/gen-rb/cassandra_constants.rb}, %q{vendor/0.8/gen-rb/cassandra_types.rb}, %q{cassandra.gemspec}]
s.homepage = %q{http://fauna.github.com/fauna/cassandra/}
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Cassandra}, %q{--main}, %q{README.md}]
s.require_paths = [%q{lib}]
s.rubyforge_project = %q{fauna}
s.rubygems_version = %q{1.8.5}
s.summary = %q{A Ruby client for the Cassandra distributed database.}
s.test_files = [%q{test/cassandra_client_test.rb}, %q{test/cassandra_mock_test.rb}, %q{test/cassandra_test.rb}, %q{test/comparable_types_test.rb}, %q{test/eventmachine_test.rb}, %q{test/ordered_hash_test.rb}, %q{test/test_helper.rb}]
s.authors = ["Evan Weaver, Ryan King"]
s.date = "2012-02-21"
s.description = "A Ruby client for the Cassandra distributed database."
s.email = ""
s.executables = ["cassandra_helper"]
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/cassandra_helper", "lib/cassandra.rb", "lib/cassandra/0.6.rb", "lib/cassandra/0.6/cassandra.rb", "lib/cassandra/0.6/columns.rb", "lib/cassandra/0.6/protocol.rb", "lib/cassandra/0.7.rb", "lib/cassandra/0.7/cassandra.rb", "lib/cassandra/0.7/columns.rb", "lib/cassandra/0.7/protocol.rb", "lib/cassandra/0.8.rb", "lib/cassandra/0.8/cassandra.rb", "lib/cassandra/0.8/columns.rb", "lib/cassandra/0.8/protocol.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.md", "Rakefile", "bin/cassandra_helper", "conf/0.6/cassandra.in.sh", "conf/0.6/log4j.properties", "conf/0.6/schema.json", "conf/0.6/storage-conf.xml", "conf/0.7/cassandra.in.sh", "conf/0.7/cassandra.yaml", "conf/0.7/log4j-server.properties", "conf/0.7/schema.json", "conf/0.7/schema.txt", "conf/0.8/cassandra.in.sh", "conf/0.8/cassandra.yaml", "conf/0.8/log4j-server.properties", "conf/0.8/schema.json", "conf/0.8/schema.txt", "lib/cassandra.rb", "lib/cassandra/0.6.rb", "lib/cassandra/0.6/cassandra.rb", "lib/cassandra/0.6/columns.rb", "lib/cassandra/0.6/protocol.rb", "lib/cassandra/0.7.rb", "lib/cassandra/0.7/cassandra.rb", "lib/cassandra/0.7/columns.rb", "lib/cassandra/0.7/protocol.rb", "lib/cassandra/0.8.rb", "lib/cassandra/0.8/cassandra.rb", "lib/cassandra/0.8/columns.rb", "lib/cassandra/0.8/protocol.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/0.6/gen-rb/cassandra.rb", "vendor/0.6/gen-rb/cassandra_constants.rb", "vendor/0.6/gen-rb/cassandra_types.rb", "vendor/0.7/gen-rb/cassandra.rb", "vendor/0.7/gen-rb/cassandra_constants.rb", "vendor/0.7/gen-rb/cassandra_types.rb", "vendor/0.8/gen-rb/cassandra.rb", "vendor/0.8/gen-rb/cassandra_constants.rb", "vendor/0.8/gen-rb/cassandra_types.rb", "cassandra.gemspec"]
s.homepage = "http://fauna.github.com/fauna/cassandra/"
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cassandra", "--main", "README.md"]
s.require_paths = ["lib"]
s.rubyforge_project = "fauna"
s.rubygems_version = "1.8.10"
s.summary = "A Ruby client for the Cassandra distributed database."
s.test_files = ["test/cassandra_mock_test.rb", "test/ordered_hash_test.rb", "test/cassandra_client_test.rb", "test/cassandra_test.rb", "test/comparable_types_test.rb", "test/test_helper.rb", "test/eventmachine_test.rb"]

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<thrift_client>, [">= 0.7.0"])
s.add_runtime_dependency(%q<thrift_client>, ["< 0.9", ">= 0.7.0"])
s.add_runtime_dependency(%q<json>, [">= 0"])
s.add_runtime_dependency(%q<rake>, [">= 0"])
s.add_runtime_dependency(%q<simple_uuid>, [">= 0.2.0"])
s.add_runtime_dependency(%q<simple_uuid>, ["~> 0.2.0"])
else
s.add_dependency(%q<thrift_client>, [">= 0.7.0"])
s.add_dependency(%q<thrift_client>, ["< 0.9", ">= 0.7.0"])
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
s.add_dependency(%q<simple_uuid>, ["~> 0.2.0"])
end
else
s.add_dependency(%q<thrift_client>, [">= 0.7.0"])
s.add_dependency(%q<thrift_client>, ["< 0.9", ">= 0.7.0"])
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
s.add_dependency(%q<simple_uuid>, ["~> 0.2.0"])
end
end
2 changes: 1 addition & 1 deletion conf/0.8/log4j-server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# (%l is slower.)

# output messages into a rolling log file as well as stdout
log4j.rootLogger=DEBUG,stdout,R
log4j.rootLogger=INFO,stdout,R

# stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
Expand Down
8 changes: 4 additions & 4 deletions conf/0.8/schema.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
create keyspace Twitter with
placement_strategy = 'org.apache.cassandra.locator.LocalStrategy' AND
placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
strategy_options = [{replication_factor:1}];
use Twitter;
create column family Users with comparator = 'UTF8Type';
Expand Down Expand Up @@ -28,22 +28,22 @@ create column family TimelinishThings with
comparator = 'BytesType';

create keyspace Multiblog with
placement_strategy = 'org.apache.cassandra.locator.LocalStrategy' AND
placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
strategy_options = [{replication_factor:1}];
use Multiblog;
create column family Blogs with comparator = 'TimeUUIDType';
create column family Comments with comparator = 'TimeUUIDType';


create keyspace MultiblogLong with
placement_strategy = 'org.apache.cassandra.locator.LocalStrategy' AND
placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
strategy_options = [{replication_factor:1}];
use MultiblogLong;
create column family Blogs with comparator = 'LongType';
create column family Comments with comparator = 'LongType';

create keyspace TypeConversions with
placement_strategy = 'org.apache.cassandra.locator.LocalStrategy' AND
placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' AND
strategy_options = [{replication_factor:1}];
use TypeConversions;
create column family UUIDColumnConversion with comparator = TimeUUIDType;
Expand Down
41 changes: 41 additions & 0 deletions conf/1.0/cassandra.in.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [ "x$CASSANDRA_HOME" = "x" ]; then
CASSANDRA_HOME=`dirname $0`/..
fi

# The directory where Cassandra's configs live (required)
if [ "x$CASSANDRA_CONF" = "x" ]; then
CASSANDRA_CONF=$CASSANDRA_HOME/conf
fi

# This can be the path to a jar file, or a directory containing the
# compiled classes. NOTE: This isn't needed by the startup script,
# it's just used here in constructing the classpath.
cassandra_bin=$CASSANDRA_HOME/build/classes/main
cassandra_bin=$cassandra_bin:$CASSANDRA_HOME/build/classes/thrift
#cassandra_bin=$cassandra_home/build/cassandra.jar

# JAVA_HOME can optionally be set here
#JAVA_HOME=/usr/local/jdk6

# The java classpath (required)
CLASSPATH=$CASSANDRA_CONF:$cassandra_bin

for jar in $CASSANDRA_HOME/lib/*.jar; do
CLASSPATH=$CLASSPATH:$jar
done
Loading

0 comments on commit c675857

Please sign in to comment.