cassandra_client 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/cassandra_client.gemspec +1 -1
- data/lib/cassandra_client/cassandra_client.rb +8 -4
- data/test/cassandra_client_test.rb +2 -2
- data.tar.gz.sig +2 -6
- metadata +1 -1
- metadata.gz.sig +1 -1
data/CHANGELOG
CHANGED
data/cassandra_client.gemspec
CHANGED
@@ -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
|
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
|
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',
|
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',
|
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
|
-
|
2
|
-
|
3
|
-
d#�p{����F���x�����9$$rQa�%��P�
|
4
|
-
�HOJ���>����,���\6UW�
|
5
|
-
�
|
6
|
-
�ٷ��
|
1
|
+
"-a�����cR��W�9�uKKJ���%�l��6ى0�H��^�#jݸRu�Y%�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
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
#���pd��w2F�='��H.�1 �w3�P[�H��a�M�<�
|