зеркало из https://github.com/github/memcached.git
Move to libmemcached 0.19.
This commit is contained in:
Родитель
4a040b92ad
Коммит
b60e2a3490
|
@ -1,5 +1,5 @@
|
|||
|
||||
v0.9. Move to libmemcached 0.19. Tests for consistent hashing behavior when a server is added/removed/pulled. Fix CAS bug (ktheory).
|
||||
v0.9. Move to libmemcached 0.19. Add some failover tests, but we are still waiting on libmemcached's replication branch for them to actually be useful. Fix CAS bug (ktheory).
|
||||
|
||||
v0.8.1. Disable NotFound backtraces for speed (Blaine Cook).
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -5,8 +5,6 @@ The Memcached client class.
|
|||
class Memcached
|
||||
|
||||
FLAGS = 0x0
|
||||
|
||||
UINT64 = 0
|
||||
|
||||
DEFAULTS = {
|
||||
:hash => :default,
|
||||
|
@ -189,7 +187,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
def set(key, value, timeout=0, marshal=true)
|
||||
value = marshal ? Marshal.dump(value) : value.to_s
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS, UINT64, Lib::SET_OP)
|
||||
Lib.memcached_set(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -197,7 +195,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
def add(key, value, timeout=0, marshal=true)
|
||||
value = marshal ? Marshal.dump(value) : value.to_s
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS, UINT64, Lib::ADD_OP)
|
||||
Lib.memcached_add(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -228,7 +226,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
def replace(key, value, timeout=0, marshal=true)
|
||||
value = marshal ? Marshal.dump(value) : value.to_s
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS, UINT64, Lib::REPLACE_OP)
|
||||
Lib.memcached_replace(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -238,7 +236,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
def append(key, value)
|
||||
# Requires memcached 1.2.4
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value.to_s, IGNORED, FLAGS, UINT64, Lib::APPEND_OP)
|
||||
Lib.memcached_append(@struct, Lib.ns(@namespace, key), value.to_s, IGNORED, FLAGS)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -246,7 +244,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
def prepend(key, value)
|
||||
# Requires memcached 1.2.4
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value.to_s, IGNORED, FLAGS, UINT64, Lib::PREPEND_OP)
|
||||
Lib.memcached_prepend(@struct, Lib.ns(@namespace, key), value.to_s, IGNORED, FLAGS)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -264,7 +262,7 @@ Please note that when non-blocking IO is enabled, setter and deleter methods do
|
|||
value = marshal ? Marshal.dump(value) : value.to_s
|
||||
|
||||
check_return_code(
|
||||
Lib.memcached_send(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS, @struct.result.cas, Lib::CAS_OP)
|
||||
Lib.memcached_cas(@struct, Lib.ns(@namespace, key), value, timeout, FLAGS, @struct.result.cas)
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -554,14 +554,12 @@ class MemcachedTest < Test::Unit::TestCase
|
|||
assert_nothing_raised do
|
||||
cache.set key, @value
|
||||
end
|
||||
ret = Rlibmemcached.memcached_send(
|
||||
ret = Rlibmemcached.memcached_set(
|
||||
cache.instance_variable_get("@struct"),
|
||||
"#{@namespace}#{key}",
|
||||
@marshalled_value,
|
||||
0,
|
||||
Memcached::FLAGS,
|
||||
Memcached::UINT64,
|
||||
Rlibmemcached::SET_OP
|
||||
Memcached::FLAGS
|
||||
)
|
||||
assert_equal 31, ret
|
||||
end
|
||||
|
@ -570,14 +568,12 @@ class MemcachedTest < Test::Unit::TestCase
|
|||
assert_nothing_raised do
|
||||
@nb_cache.set key, @value
|
||||
end
|
||||
ret = Rlibmemcached.memcached_send(
|
||||
ret = Rlibmemcached.memcached_set(
|
||||
@nb_cache.instance_variable_get("@struct"),
|
||||
"#{@namespace}#{key}",
|
||||
@marshalled_value,
|
||||
0,
|
||||
Memcached::FLAGS,
|
||||
Memcached::UINT64,
|
||||
Rlibmemcached::SET_OP
|
||||
Memcached::FLAGS
|
||||
)
|
||||
assert_equal 31, ret
|
||||
end
|
||||
|
@ -625,7 +621,9 @@ class MemcachedTest < Test::Unit::TestCase
|
|||
cache.set(key, @value)
|
||||
cache.get(key)
|
||||
end
|
||||
|
||||
|
||||
return
|
||||
# XXX Waiting on failover support in Libmemcached
|
||||
assert_nothing_raised do
|
||||
cache.set(key, @value)
|
||||
cache.get(key)
|
||||
|
|
Загрузка…
Ссылка в новой задаче