Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added multiple fixes to the voldemort ruby client

  • Loading branch information...
commit 6388c9439d0e9b6feba0495ec3b1e22e836d17a6 1 parent 3fea647
Alejandro Crosa authored
View
18 clients/ruby/lib/connection/connection.rb
@@ -85,12 +85,12 @@ def parse_nodes_from(doc)
nodes = []
doc.xpath("/cluster/server").each do |n|
node = VoldemortNode.new
- node.id = n.xpath("//id").text
- node.host = n.xpath("//host").text
- node.port = n.xpath("//socket-port").text
- node.http_port = n.xpath("//http_port").text
- node.admin_port = n.xpath("//admin-port").text
- node.partitions = n.xpath("//partitions").text
+ node.id = n.xpath("id").text
+ node.host = n.xpath("host").text
+ node.port = n.xpath("socket-port").text
+ node.http_port = n.xpath("http_port").text
+ node.admin_port = n.xpath("admin-port").text
+ node.partitions = n.xpath("partitions").text
nodes << node
end
nodes
@@ -128,15 +128,15 @@ def rebalance_connection_if_needed
def get(key)
self.rebalance_connection_if_needed
- self.get_from(self.db_name, key, true)
+ self.get_from(self.db_name, key, false)
end
def get_all(keys)
self.rebalance_connection_if_needed
- self.get_all_from(self.db_name, keys, true)
+ self.get_all_from(self.db_name, keys, false)
end
- def put(key, value, version = nil, route = true)
+ def put(key, value, version = nil, route = false)
self.rebalance_connection_if_needed
self.put_from(self.db_name, key, value, version, route)
end
View
8 clients/ruby/lib/connection/tcp_connection.rb
@@ -28,7 +28,7 @@ def connect_to(host, port)
end
end
- def get_from(db_name, key, route = true)
+ def get_from(db_name, key, route = false)
request = VoldemortRequest.new
request.should_route = route
request.store = db_name
@@ -43,7 +43,7 @@ def get_from(db_name, key, route = true)
response
end
- def get_all_from(db_name, keys, route = true)
+ def get_all_from(db_name, keys, route = false)
request = VoldemortRequest.new
request.should_route = route
request.store = db_name
@@ -58,7 +58,7 @@ def get_all_from(db_name, keys, route = true)
response
end
- def put_from(db_name, key, value, version = nil, route = true)
+ def put_from(db_name, key, value, version = nil, route = false)
version = get_version(key) unless version
request = VoldemortRequest.new
request.should_route = route
@@ -80,7 +80,7 @@ def put_from(db_name, key, value, version = nil, route = true)
version
end
- def delete_from(db_name, key, version = nil, route = true)
+ def delete_from(db_name, key, version = nil, route = false)
version = get_version(key) unless version
request = VoldemortRequest.new
request.should_route = route
View
2  clients/ruby/lib/voldemort-serializer.rb
@@ -54,7 +54,7 @@ def read_slice(length, bytes)
def to_bytes(object)
bytes = ''
- newest_version = 0 # TODO get highest number from map
+ newest_version = type_def_versions.size > 0 ? (type_def_versions.size-1) : 0
type_def = @type_def_versions[newest_version]
if(@has_version)
View
2  clients/ruby/voldemort-rb.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'voldemort-rb'
- s.version = '0.1.5'
+ s.version = '0.1.8'
s.summary = %{A Ruby client for the Voldemort distributed key value store}
s.description = %Q{voldemort-rb allows you to connect to the Voldemort descentralized key value store.}
s.authors = ["Alejandro Crosa"]
Please sign in to comment.
Something went wrong with that request. Please try again.