voldemort-rb 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/connection/connection.rb +10 -9
- data/lib/connection/tcp_connection.rb +4 -4
- data/lib/voldemort-serializer.rb +1 -1
- metadata +4 -4
@@ -83,14 +83,15 @@ class Connection
|
|
83
83
|
|
84
84
|
def parse_nodes_from(doc)
|
85
85
|
nodes = []
|
86
|
+
puts "DOC\n\n#{doc}"
|
86
87
|
doc.xpath("/cluster/server").each do |n|
|
87
88
|
node = VoldemortNode.new
|
88
|
-
node.id = n.xpath("
|
89
|
-
node.host = n.xpath("
|
90
|
-
node.port = n.xpath("
|
91
|
-
node.http_port = n.xpath("
|
92
|
-
node.admin_port = n.xpath("
|
93
|
-
node.partitions = n.xpath("
|
89
|
+
node.id = n.xpath("id").text
|
90
|
+
node.host = n.xpath("host").text
|
91
|
+
node.port = n.xpath("socket-port").text
|
92
|
+
node.http_port = n.xpath("http_port").text
|
93
|
+
node.admin_port = n.xpath("admin-port").text
|
94
|
+
node.partitions = n.xpath("partitions").text
|
94
95
|
nodes << node
|
95
96
|
end
|
96
97
|
nodes
|
@@ -128,15 +129,15 @@ class Connection
|
|
128
129
|
|
129
130
|
def get(key)
|
130
131
|
self.rebalance_connection_if_needed
|
131
|
-
self.get_from(self.db_name, key,
|
132
|
+
self.get_from(self.db_name, key, false)
|
132
133
|
end
|
133
134
|
|
134
135
|
def get_all(keys)
|
135
136
|
self.rebalance_connection_if_needed
|
136
|
-
self.get_all_from(self.db_name, keys,
|
137
|
+
self.get_all_from(self.db_name, keys, false)
|
137
138
|
end
|
138
139
|
|
139
|
-
def put(key, value, version = nil, route =
|
140
|
+
def put(key, value, version = nil, route = false)
|
140
141
|
self.rebalance_connection_if_needed
|
141
142
|
self.put_from(self.db_name, key, value, version, route)
|
142
143
|
end
|
@@ -28,7 +28,7 @@ class TCPConnection < Connection
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def get_from(db_name, key, route =
|
31
|
+
def get_from(db_name, key, route = false)
|
32
32
|
request = VoldemortRequest.new
|
33
33
|
request.should_route = route
|
34
34
|
request.store = db_name
|
@@ -43,7 +43,7 @@ class TCPConnection < Connection
|
|
43
43
|
response
|
44
44
|
end
|
45
45
|
|
46
|
-
def get_all_from(db_name, keys, route =
|
46
|
+
def get_all_from(db_name, keys, route = false)
|
47
47
|
request = VoldemortRequest.new
|
48
48
|
request.should_route = route
|
49
49
|
request.store = db_name
|
@@ -58,7 +58,7 @@ class TCPConnection < Connection
|
|
58
58
|
response
|
59
59
|
end
|
60
60
|
|
61
|
-
def put_from(db_name, key, value, version = nil, route =
|
61
|
+
def put_from(db_name, key, value, version = nil, route = false)
|
62
62
|
version = get_version(key) unless version
|
63
63
|
request = VoldemortRequest.new
|
64
64
|
request.should_route = route
|
@@ -80,7 +80,7 @@ class TCPConnection < Connection
|
|
80
80
|
version
|
81
81
|
end
|
82
82
|
|
83
|
-
def delete_from(db_name, key, version = nil, route =
|
83
|
+
def delete_from(db_name, key, version = nil, route = false)
|
84
84
|
version = get_version(key) unless version
|
85
85
|
request = VoldemortRequest.new
|
86
86
|
request.should_route = route
|
data/lib/voldemort-serializer.rb
CHANGED
@@ -54,7 +54,7 @@ class VoldemortJsonBinarySerializer
|
|
54
54
|
|
55
55
|
def to_bytes(object)
|
56
56
|
bytes = ''
|
57
|
-
newest_version =
|
57
|
+
newest_version = type_def_versions.size > 0 ? (type_def_versions.size-1) : 0
|
58
58
|
type_def = @type_def_versions[newest_version]
|
59
59
|
|
60
60
|
if(@has_version)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voldemort-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alejandro Crosa
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-12 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|