cassandra 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/CHANGELOG +10 -0
  2. data/LICENSE +0 -0
  3. data/Manifest +12 -13
  4. data/README.md +344 -0
  5. data/Rakefile +52 -8
  6. data/cassandra.gemspec +5 -5
  7. data/conf/0.6/cassandra.in.sh +0 -0
  8. data/conf/0.6/log4j.properties +0 -0
  9. data/conf/0.6/schema.json +9 -0
  10. data/conf/0.6/storage-conf.xml +10 -0
  11. data/conf/0.7/cassandra.in.sh +0 -0
  12. data/conf/0.7/cassandra.yaml +0 -0
  13. data/conf/0.7/log4j-server.properties +0 -0
  14. data/conf/0.7/schema.json +9 -0
  15. data/conf/0.7/schema.txt +5 -16
  16. data/conf/0.8/cassandra.in.sh +0 -0
  17. data/conf/0.8/cassandra.yaml +1 -1
  18. data/conf/0.8/log4j-server.properties +0 -0
  19. data/conf/0.8/schema.json +19 -1
  20. data/conf/0.8/schema.txt +12 -17
  21. data/lib/cassandra.rb +3 -2
  22. data/lib/cassandra/0.6.rb +0 -0
  23. data/lib/cassandra/0.6/cassandra.rb +57 -6
  24. data/lib/cassandra/0.6/columns.rb +19 -0
  25. data/lib/cassandra/0.6/protocol.rb +2 -1
  26. data/lib/cassandra/0.7.rb +0 -0
  27. data/lib/cassandra/0.7/cassandra.rb +0 -270
  28. data/lib/cassandra/0.7/columns.rb +1 -81
  29. data/lib/cassandra/0.7/protocol.rb +0 -112
  30. data/lib/cassandra/0.8.rb +0 -0
  31. data/lib/cassandra/0.8/cassandra.rb +5 -267
  32. data/lib/cassandra/0.8/columns.rb +1 -81
  33. data/lib/cassandra/0.8/protocol.rb +9 -103
  34. data/lib/cassandra/array.rb +0 -0
  35. data/lib/cassandra/cassandra.rb +715 -92
  36. data/lib/cassandra/{0.7/column_family.rb → column_family.rb} +0 -0
  37. data/lib/cassandra/columns.rb +63 -6
  38. data/lib/cassandra/comparable.rb +0 -0
  39. data/lib/cassandra/constants.rb +0 -0
  40. data/lib/cassandra/debug.rb +0 -0
  41. data/lib/cassandra/helpers.rb +0 -0
  42. data/lib/cassandra/{0.7/keyspace.rb → keyspace.rb} +0 -0
  43. data/lib/cassandra/long.rb +0 -0
  44. data/lib/cassandra/mock.rb +45 -8
  45. data/lib/cassandra/ordered_hash.rb +0 -0
  46. data/lib/cassandra/protocol.rb +119 -0
  47. data/lib/cassandra/time.rb +0 -0
  48. data/test/cassandra_client_test.rb +0 -0
  49. data/test/cassandra_mock_test.rb +3 -0
  50. data/test/cassandra_test.rb +202 -20
  51. data/test/comparable_types_test.rb +0 -0
  52. data/test/eventmachine_test.rb +0 -0
  53. data/test/ordered_hash_test.rb +0 -0
  54. data/test/test_helper.rb +1 -1
  55. data/vendor/0.6/gen-rb/cassandra.rb +0 -0
  56. data/vendor/0.6/gen-rb/cassandra_constants.rb +0 -0
  57. data/vendor/0.6/gen-rb/cassandra_types.rb +0 -0
  58. data/vendor/0.7/gen-rb/cassandra.rb +0 -0
  59. data/vendor/0.7/gen-rb/cassandra_constants.rb +0 -0
  60. data/vendor/0.7/gen-rb/cassandra_types.rb +0 -0
  61. data/vendor/0.8/gen-rb/cassandra.rb +0 -0
  62. data/vendor/0.8/gen-rb/cassandra_constants.rb +0 -0
  63. data/vendor/0.8/gen-rb/cassandra_types.rb +0 -0
  64. metadata +27 -29
  65. data/README.rdoc +0 -99
  66. data/lib/cassandra/0.8/column_family.rb +0 -3
  67. data/lib/cassandra/0.8/keyspace.rb +0 -3
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- CASSANDRA_VERSION ||= ENV['CASSANDRA_VERSION'] || '0.7'
1
+ CASSANDRA_VERSION = ENV['CASSANDRA_VERSION'] || '0.7' unless defined?(CASSANDRA_VERSION)
2
2
 
3
3
  require 'test/unit'
4
4
  require "#{File.expand_path(File.dirname(__FILE__))}/../lib/cassandra/#{CASSANDRA_VERSION}"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 11
9
- - 0
10
- version: 0.11.0
9
+ - 1
10
+ version: 0.11.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Evan Weaver, Ryan King
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-18 00:00:00 Z
18
+ date: 2011-06-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: thrift_client
@@ -84,41 +84,44 @@ executables:
84
84
  extensions: []
85
85
 
86
86
  extra_rdoc_files:
87
- - bin/cassandra_helper
88
87
  - CHANGELOG
88
+ - LICENSE
89
+ - README.md
90
+ - bin/cassandra_helper
91
+ - lib/cassandra.rb
92
+ - lib/cassandra/0.6.rb
89
93
  - lib/cassandra/0.6/cassandra.rb
90
94
  - lib/cassandra/0.6/columns.rb
91
95
  - lib/cassandra/0.6/protocol.rb
92
- - lib/cassandra/0.6.rb
96
+ - lib/cassandra/0.7.rb
93
97
  - lib/cassandra/0.7/cassandra.rb
94
- - lib/cassandra/0.7/column_family.rb
95
98
  - lib/cassandra/0.7/columns.rb
96
- - lib/cassandra/0.7/keyspace.rb
97
99
  - lib/cassandra/0.7/protocol.rb
98
- - lib/cassandra/0.7.rb
100
+ - lib/cassandra/0.8.rb
99
101
  - lib/cassandra/0.8/cassandra.rb
100
- - lib/cassandra/0.8/column_family.rb
101
102
  - lib/cassandra/0.8/columns.rb
102
- - lib/cassandra/0.8/keyspace.rb
103
103
  - lib/cassandra/0.8/protocol.rb
104
- - lib/cassandra/0.8.rb
105
104
  - lib/cassandra/array.rb
106
105
  - lib/cassandra/cassandra.rb
106
+ - lib/cassandra/column_family.rb
107
107
  - lib/cassandra/columns.rb
108
108
  - lib/cassandra/comparable.rb
109
109
  - lib/cassandra/constants.rb
110
110
  - lib/cassandra/debug.rb
111
111
  - lib/cassandra/helpers.rb
112
+ - lib/cassandra/keyspace.rb
112
113
  - lib/cassandra/long.rb
113
114
  - lib/cassandra/mock.rb
114
115
  - lib/cassandra/ordered_hash.rb
116
+ - lib/cassandra/protocol.rb
115
117
  - lib/cassandra/time.rb
116
- - lib/cassandra.rb
117
- - LICENSE
118
- - README.rdoc
119
118
  files:
120
- - bin/cassandra_helper
121
119
  - CHANGELOG
120
+ - LICENSE
121
+ - Manifest
122
+ - README.md
123
+ - Rakefile
124
+ - bin/cassandra_helper
122
125
  - conf/0.6/cassandra.in.sh
123
126
  - conf/0.6/log4j.properties
124
127
  - conf/0.6/schema.json
@@ -133,38 +136,33 @@ files:
133
136
  - conf/0.8/log4j-server.properties
134
137
  - conf/0.8/schema.json
135
138
  - conf/0.8/schema.txt
139
+ - lib/cassandra.rb
140
+ - lib/cassandra/0.6.rb
136
141
  - lib/cassandra/0.6/cassandra.rb
137
142
  - lib/cassandra/0.6/columns.rb
138
143
  - lib/cassandra/0.6/protocol.rb
139
- - lib/cassandra/0.6.rb
144
+ - lib/cassandra/0.7.rb
140
145
  - lib/cassandra/0.7/cassandra.rb
141
- - lib/cassandra/0.7/column_family.rb
142
146
  - lib/cassandra/0.7/columns.rb
143
- - lib/cassandra/0.7/keyspace.rb
144
147
  - lib/cassandra/0.7/protocol.rb
145
- - lib/cassandra/0.7.rb
148
+ - lib/cassandra/0.8.rb
146
149
  - lib/cassandra/0.8/cassandra.rb
147
- - lib/cassandra/0.8/column_family.rb
148
150
  - lib/cassandra/0.8/columns.rb
149
- - lib/cassandra/0.8/keyspace.rb
150
151
  - lib/cassandra/0.8/protocol.rb
151
- - lib/cassandra/0.8.rb
152
152
  - lib/cassandra/array.rb
153
153
  - lib/cassandra/cassandra.rb
154
+ - lib/cassandra/column_family.rb
154
155
  - lib/cassandra/columns.rb
155
156
  - lib/cassandra/comparable.rb
156
157
  - lib/cassandra/constants.rb
157
158
  - lib/cassandra/debug.rb
158
159
  - lib/cassandra/helpers.rb
160
+ - lib/cassandra/keyspace.rb
159
161
  - lib/cassandra/long.rb
160
162
  - lib/cassandra/mock.rb
161
163
  - lib/cassandra/ordered_hash.rb
164
+ - lib/cassandra/protocol.rb
162
165
  - lib/cassandra/time.rb
163
- - lib/cassandra.rb
164
- - LICENSE
165
- - Manifest
166
- - Rakefile
167
- - README.rdoc
168
166
  - test/cassandra_client_test.rb
169
167
  - test/cassandra_mock_test.rb
170
168
  - test/cassandra_test.rb
@@ -192,7 +190,7 @@ rdoc_options:
192
190
  - --title
193
191
  - Cassandra
194
192
  - --main
195
- - README.rdoc
193
+ - README.md
196
194
  require_paths:
197
195
  - lib
198
196
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -1,99 +0,0 @@
1
- = cassandra
2
-
3
- A Ruby client for the Cassandra distributed database.
4
-
5
- == License
6
-
7
- Copyright 2009, 2010 Twitter, Inc. See included LICENSE file. Portions copyright 2004-2009 David Heinemeier Hansson, and used with permission.
8
-
9
- == Features
10
-
11
- * clean encapsulation of the Thrift API
12
- * compatible UUID and Long classes, for GUID generation
13
- * Ruby 1.9 compatibility
14
-
15
- The Github source repository is {here}[http://github.com/fauna/cassandra/]. Patches and contributions are very welcome.
16
-
17
- == Installation
18
-
19
- You need Ruby 1.8 or 1.9. If you have those, just run:
20
-
21
- sudo gem install cassandra
22
-
23
- Cassandra itself is a rapidly moving target. In order to get a working server, use the `bin/cassandra_helper` script:
24
-
25
- CASSANDRA_VERSION=0.8 cassandra_helper cassandra
26
-
27
- Specify the Cassandra version by setting the CASSANDRA_VERSION
28
- environment variable. A server will be installed in `$HOME/cassandra/cassandra-VERSION`, and started in debug mode.
29
-
30
- WARNING: Don't use the test folder for your data, as it will get overwritten when you update the gem.
31
-
32
- == Usage
33
-
34
- Now, start IRb and require the library, which defaults to version 0.6 of the Cassandra API:
35
-
36
- require 'cassandra'
37
-
38
- Alternatively, you can specify a version of the Cassandra API to use:
39
-
40
- require 'cassandra/0.6'
41
-
42
- or
43
-
44
- require 'cassandra/0.7'
45
-
46
- Connect to a server and keyspace:
47
-
48
- client = Cassandra.new('Twitter', '127.0.0.1:9160')
49
-
50
- Login on server if the keyspace require authentication:
51
-
52
- client.login!('username','password')
53
-
54
- Insert into a column family. You can insert a `Cassandra::OrderedHash`, or a regular Hash, if order doesn't matter:
55
-
56
- client.insert(:Users, "5", {'screen_name' => "buttonscat"})
57
-
58
- The 0.7 API insert() includes support for TTL on columns. The following example inserts into a comlumn family with a time to live of 30 seconds.
59
-
60
- client.insert(:Users, "5", {'screen_name' => "buttonscat"}, {:ttl=>30})
61
-
62
- Insert into a super column family:
63
-
64
- client.insert(:UserRelationships, "5", {"user_timeline" => {UUID.new => "1"}})
65
-
66
- Query a super column:
67
-
68
- timeline = client.get(:UserRelationships, "5", "user_timeline")
69
-
70
- The returned result will always be a Cassandra::OrderedHash.
71
-
72
- Create and delete a 2ary index:
73
-
74
- client.create_index("Twitter", "Users", "revenue_generating_units", "LongType")
75
- client.delete_index("Twitter", "Users", "revenue_generating_units"
76
-
77
- Create an index clause and query an indexed column family:
78
-
79
- expr = client.create_idx_expr("revenue_generating_units", 100, ">")
80
- clause = client.create_idx_clause([expr])
81
- client.get_indexed_slices(:Users, clause)
82
-
83
- See Cassandra for more methods.
84
-
85
- == Configuration
86
-
87
- By default, cassandra is setup to listen on localhost. If you want to move your clients to another host, you're going to need to change which interface it binds to in the storage-conf.xml. You should also change the seed address.
88
-
89
- == Node Auto-Discovery
90
-
91
- The list of hosts you pass to the client is only used to auto-discover all the nodes in your cluster. You don't need to give the client a list of all of your nodes.
92
-
93
- == Further reading
94
-
95
- * {Up and Running With Cassandra}[http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra]
96
-
97
- == Reporting problems
98
-
99
- The Github issue tracker is {here}[http://github.com/fauna/cassandra/issues]. If you have problems with this library or Cassandra itself, please use the {cassandra-user mailing list}[http://mail-archives.apache.org/mod_mbox/incubator-cassandra-user/].
@@ -1,3 +0,0 @@
1
- class Cassandra
2
- class ColumnFamily < CassandraThrift::CfDef ; end
3
- end
@@ -1,3 +0,0 @@
1
- class Cassandra
2
- class Keyspace < CassandraThrift::KsDef ; end
3
- end