cassandra_client 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v0.2.2. Use nil for empty byte array, not empty string. Improves API.
3
+
2
4
  v0.2.1. Don't write serialization overhead on nulls.
3
5
 
4
6
  v0.2. Re-factor table vs. column family interface per discussion with jbellis.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cassandra_client}
5
- s.version = "0.2.1"
5
+ s.version = "0.2.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
@@ -147,7 +147,11 @@ class CassandraClient
147
147
  end
148
148
  rescue NotFoundException
149
149
  is_super(column_family) && !column ? {} : nil
150
- end
150
+ end
151
+
152
+ # FIXME
153
+ # def exists?
154
+ # end
151
155
 
152
156
  # FIXME
153
157
  # def get_recent(column_family, key, super_column = nil, column = nil, timestamp = 0)
@@ -169,13 +173,13 @@ class CassandraClient
169
173
  private
170
174
 
171
175
  def dump(object)
172
- # Special-case the empty string, so we don't store worthless serializer overhead on nulls
173
- return "" if object == ""
176
+ # Special-case nil as the empty byte array
177
+ return "" if object == nil
174
178
  @serializer.dump(object)
175
179
  end
176
180
 
177
181
  def load(object)
178
- return "" if object == ""
182
+ return nil if object == ""
179
183
  @serializer.load(object)
180
184
  end
181
185
  end
@@ -36,14 +36,14 @@ class CassandraClientTest < Test::Unit::TestCase
36
36
 
37
37
  def test_get_key_name_sorted_preserving_order
38
38
  # In-order hash is preserved
39
- hash = CassandraClient::OrderedHash['a', '', 'b', '', 'c', '', 'd', '',]
39
+ hash = CassandraClient::OrderedHash['a', nil, 'b', nil, 'c', nil, 'd', nil,]
40
40
  @twitter.insert(:Users, key, hash)
41
41
  assert_equal(hash.keys, @twitter.get(:Users, key).keys)
42
42
 
43
43
  @twitter.remove(:Users, key)
44
44
 
45
45
  # Out-of-order hash is returned sorted
46
- hash = CassandraClient::OrderedHash['b', '', 'c', '', 'd', '', 'a', '']
46
+ hash = CassandraClient::OrderedHash['b', nil, 'c', nil, 'd', nil, 'a', nil]
47
47
  @twitter.insert(:Users, key, hash)
48
48
  assert_equal(hash.keys.sort, @twitter.get(:Users, key).keys)
49
49
  assert_not_equal(hash.keys, @twitter.get(:Users, key).keys)
data.tar.gz.sig CHANGED
@@ -1,6 +1,2 @@
1
- R?��h�AncW���mU�����g��
2
- �&��r|fb�.�ǓE���_f�l�)���W�Ck��R�V�GD�� 4�y��‘��b!��>��/:��TrgF�����̍����b��0l���J�����;�[ ,��ah�K;��Sl!�e�uM�N���ѯB����&j4�/7�a��(�
3
- d#�p{����F���x�����9$$rQa�%��P�
4
- �HOJ���>����,���\6UW�
5
-
6
- �ٷ��
1
+ "-a�����cR��W�9�uKKJ���%�l��6ى0�H��^�#jݸRuY%�XFro߰>|�5��~4�`��䖘�����O�e�)�D$�*�Uz1GG��dzg����-J�}-�$Y�u1�b���U��1�ؤ,"�#�3AG�T� ��Y��?=���Ii�e?��ȅs�hi�qy���BjDG���7���LȘ�uMw L5)��T�T3ڹ-
2
+ �:q�o
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- �%JfBM�Ma5��A��+P�v9�~��4�_��[��p�ݍ��3`�F<Ae�%���]����T��릿� HP���l`>���rB����3�gF ����!b�3^��Z7_���HU"E'K݃p %�Ȯ+�L��k�~�����Bi ��#�(�S�l<7^��ci�"�6�<�q�.v���]��t�w�;�ܖj}��q����BQ]VL��.ѳ������Y�� 3
1
+ #���pd��w2F�='��H.�1 w3�P[H��a�M�<�