localmemcache 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +5 -2
- data/Rakefile +4 -0
- data/VERSION +1 -1
- data/bench/lmc_bench.rb +1 -1
- data/bench/tokyo_cabinet_bench +3 -0
- data/bench/tokyo_cabinet_bench.rb +20 -0
- data/site/doc/classes/LocalMemCache.html +146 -129
- data/site/doc/classes/LocalMemCache.src/M000001.html +1 -1
- data/site/doc/classes/LocalMemCache.src/M000002.html +26 -5
- data/site/doc/classes/LocalMemCache.src/M000003.html +16 -5
- data/site/doc/classes/LocalMemCache.src/M000004.html +7 -23
- data/site/doc/classes/LocalMemCache.src/M000005.html +7 -13
- data/site/doc/classes/LocalMemCache.src/M000006.html +4 -5
- data/site/doc/classes/LocalMemCache.src/M000007.html +6 -5
- data/site/doc/classes/LocalMemCache.src/M000008.html +6 -6
- data/site/doc/classes/LocalMemCache.src/M000009.html +1 -1
- data/site/doc/classes/LocalMemCache.src/M000010.html +4 -6
- data/site/doc/classes/LocalMemCache.src/M000011.html +4 -4
- data/site/doc/classes/LocalMemCache.src/M000012.html +4 -4
- data/site/doc/classes/LocalMemCache/ArgError.html +2 -2
- data/site/doc/classes/LocalMemCache/InitError.html +2 -2
- data/site/doc/classes/LocalMemCache/LocalMemCacheError.html +2 -2
- data/site/doc/classes/LocalMemCache/LockError.html +2 -2
- data/site/doc/classes/LocalMemCache/LockTimedOut.html +2 -2
- data/site/doc/classes/LocalMemCache/MemoryPoolClosed.html +2 -2
- data/site/doc/classes/LocalMemCache/MemoryPoolFull.html +2 -2
- data/site/doc/classes/LocalMemCache/OutOfMemoryError.html +2 -2
- data/site/doc/classes/LocalMemCache/RecoveryFailed.html +2 -2
- data/site/doc/classes/LocalMemCache/ShmError.html +2 -2
- data/site/doc/classes/LocalMemCache/ShmLockFailed.html +2 -2
- data/site/doc/classes/LocalMemCache/ShmUnlockFailed.html +2 -2
- data/site/doc/created.rid +1 -1
- data/site/doc/fr_class_index.html +2 -0
- data/site/doc/fr_file_index.html +3 -2
- data/site/doc/fr_method_index.html +17 -11
- data/site/doc/index.html +1 -1
- data/site/index.html +33 -17
- data/src/lmc_common.c +2 -1
- data/src/lmc_common.h +1 -1
- data/src/lmc_hashtable.c +62 -2
- data/src/lmc_hashtable.h +4 -1
- data/src/lmc_shm.c +1 -3
- data/src/lmc_shm.h +1 -3
- data/src/lmc_valloc.c +5 -0
- data/src/lmc_valloc.h +1 -0
- data/src/localmemcache.c +43 -8
- data/src/localmemcache.h +24 -6
- data/src/ruby-binding/localmemcache.rb +14 -29
- data/src/ruby-binding/rblocalmemcache.c +127 -16
- data/src/tests/allocfailure.rb +1 -1
- data/src/tests/bench.rb +1 -1
- data/src/tests/bench_keys.rb +1 -1
- data/src/tests/crash.rb +1 -1
- data/src/tests/lmc.rb +65 -9
- data/src/tests/lmctestapi.c +1 -1
- data/src/tests/parallelwrite.rb +1 -1
- data/src/tests/ttkeys +10 -0
- data/src/tests/ttkeys.rb +35 -0
- data/src/tests/ttlmc.rb +24 -6
- data/src/tests/ttrandom_pair +10 -0
- data/src/tests/ttrandom_pair.rb +23 -0
- metadata +8 -5
- data/site/doc/files/__/src/ruby-binding/extconf_rb.html +0 -108
- data/site/doc/files/__/src/ruby-binding/localmemcache_rb.html +0 -108
- data/site/doc/files/__/src/ruby-binding/rblocalmemcache_c.html +0 -101
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File
|
13
|
+
<pre><span class="ruby-comment cmt"># File localmemcache.rb, line 40</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
15
15
|
<span class="ruby-identifier">o</span> = { <span class="ruby-identifier">:size_mb</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span> }.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span> <span class="ruby-operator">||</span> {})
|
16
16
|
<span class="ruby-identifier">_new</span>(<span class="ruby-identifier">o</span>);
|
@@ -5,14 +5,35 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>drop (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre>/*
|
14
|
+
* call-seq: LocalMemCache.drop(*args)
|
15
|
+
*
|
16
|
+
* Deletes a memory pool. If the :force option is set, locked semaphores are
|
17
|
+
* removed as well.
|
18
|
+
*
|
19
|
+
* WARNING: Do only call this method with the :force option if you are sure
|
20
|
+
* that you really want to remove this memory pool and no more processes are
|
21
|
+
* still using it.
|
22
|
+
*
|
23
|
+
* If you delete a pool and other processes still have handles open on it, the
|
24
|
+
* status of these handles becomes undefined. There's no way for a process to
|
25
|
+
* know when a handle is not valid anymore, so only delete a memory pool if
|
26
|
+
* you are sure that all handles are closed.
|
27
|
+
*
|
28
|
+
* valid options for drop are
|
29
|
+
* [:namespace]
|
30
|
+
* [:filename]
|
31
|
+
* [:force]
|
32
|
+
*
|
33
|
+
* The memory pool must be specified by either setting the :filename or
|
34
|
+
* :namespace option. The default for :force is false.
|
35
|
+
*/
|
36
|
+
static VALUE LocalMemCache__drop(VALUE klass, VALUE o) {
|
37
|
+
</pre>
|
17
38
|
</body>
|
18
39
|
</html>
|
@@ -5,14 +5,25 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>check (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre>/*
|
14
|
+
* call-seq: LocalMemCache.check(*args)
|
15
|
+
*
|
16
|
+
* Tries to repair a corrupt namespace. Usually one doesn't call this method
|
17
|
+
* directly, it's invoked automatically when operations time out.
|
18
|
+
*
|
19
|
+
* valid options are
|
20
|
+
* [:namespace]
|
21
|
+
* [:filename]
|
22
|
+
*
|
23
|
+
* The memory pool must be specified by either setting the :filename or
|
24
|
+
* :namespace option.
|
25
|
+
*/
|
26
|
+
static VALUE LocalMemCache__check(VALUE klass, VALUE o) {
|
27
|
+
</pre>
|
17
28
|
</body>
|
18
29
|
</html>
|
@@ -5,35 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>get (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>/*
|
14
|
-
*
|
13
|
+
<pre>/*
|
14
|
+
* call-seq:
|
15
|
+
* lmc.get(key) -> string value or nil
|
16
|
+
* lmc[key] -> string value or nil
|
15
17
|
*
|
16
|
-
*
|
17
|
-
* removed as well.
|
18
|
-
*
|
19
|
-
* WARNING: Do only call this method with the :repair option if you are sure
|
20
|
-
* that you really want to remove this memory pool and no more processes are
|
21
|
-
* still using it.
|
22
|
-
*
|
23
|
-
* If you delete a pool and other processes still have handles open on it, the
|
24
|
-
* status of these handles becomes undefined. There's no way for a process to
|
25
|
-
* know when a handle is not valid anymore, so only delete a memory pool if
|
26
|
-
* you are sure that all handles are closed.
|
27
|
-
*
|
28
|
-
* valid options for clear are
|
29
|
-
* [:namespace]
|
30
|
-
* [:filename]
|
31
|
-
* [:repair]
|
32
|
-
*
|
33
|
-
* The memory pool must be specified by either setting the :filename or
|
34
|
-
* :namespace option. The default for :repair is false.
|
18
|
+
* Retrieve string value from hashtable.
|
35
19
|
*/
|
36
|
-
static VALUE
|
20
|
+
static VALUE LocalMemCache__get(VALUE obj, VALUE key) {
|
37
21
|
</pre>
|
38
22
|
</body>
|
39
23
|
</html>
|
@@ -5,25 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>[] (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>/*
|
14
|
-
*
|
13
|
+
<pre>/*
|
14
|
+
* call-seq:
|
15
|
+
* lmc.get(key) -> string value or nil
|
16
|
+
* lmc[key] -> string value or nil
|
15
17
|
*
|
16
|
-
*
|
17
|
-
* directly, it's invoked automatically when operations time out.
|
18
|
-
*
|
19
|
-
* valid options are
|
20
|
-
* [:namespace]
|
21
|
-
* [:filename]
|
22
|
-
*
|
23
|
-
* The memory pool must be specified by either setting the :filename or
|
24
|
-
* :namespace option.
|
18
|
+
* Retrieve string value from hashtable.
|
25
19
|
*/
|
26
|
-
static VALUE
|
20
|
+
static VALUE LocalMemCache__get(VALUE obj, VALUE key) {
|
27
21
|
</pre>
|
28
22
|
</body>
|
29
23
|
</html>
|
@@ -5,19 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>delete (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/*
|
14
14
|
* call-seq:
|
15
|
-
* lmc.
|
16
|
-
* lmc[key] -> string value or nil
|
15
|
+
* lmc.delete(key) -> Qnil
|
17
16
|
*
|
18
|
-
*
|
17
|
+
* Deletes key from hashtable. The key is converted to string.
|
19
18
|
*/
|
20
|
-
static VALUE
|
19
|
+
static VALUE LocalMemCache__delete(VALUE obj, VALUE key) {
|
21
20
|
</pre>
|
22
21
|
</body>
|
23
22
|
</html>
|
@@ -5,19 +5,20 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>set (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/*
|
14
14
|
* call-seq:
|
15
|
-
* lmc.
|
16
|
-
* lmc[key]
|
15
|
+
* lmc.set(key, value) -> Qnil
|
16
|
+
* lmc[key]=value -> Qnil
|
17
17
|
*
|
18
|
-
*
|
18
|
+
* Set value for key in hashtable. Value and key will be converted to
|
19
|
+
* string.
|
19
20
|
*/
|
20
|
-
static VALUE
|
21
|
+
static VALUE LocalMemCache__set(VALUE obj, VALUE key, VALUE value) {
|
21
22
|
</pre>
|
22
23
|
</body>
|
23
24
|
</html>
|
@@ -5,18 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>clear (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre>/*
|
14
|
-
* call-seq:
|
15
|
-
* lmc.
|
13
|
+
<pre>/*
|
14
|
+
* call-seq:
|
15
|
+
* lmc.clear -> Qnil
|
16
16
|
*
|
17
|
-
*
|
17
|
+
* Clears content of hashtable.
|
18
18
|
*/
|
19
|
-
static VALUE
|
19
|
+
static VALUE LocalMemCache__clear(VALUE obj) {
|
20
20
|
</pre>
|
21
21
|
</body>
|
22
22
|
</html>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>[]= (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
@@ -5,20 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>keys (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/*
|
14
14
|
* call-seq:
|
15
|
-
* lmc.
|
16
|
-
* lmc[key]=value -> Qnil
|
15
|
+
* lmc.keys() -> array or nil
|
17
16
|
*
|
18
|
-
*
|
19
|
-
* string.
|
17
|
+
* Returns a list of keys.
|
20
18
|
*/
|
21
|
-
static VALUE
|
19
|
+
static VALUE LocalMemCache__keys(VALUE obj) {
|
22
20
|
</pre>
|
23
21
|
</body>
|
24
22
|
</html>
|
@@ -5,18 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>each_pair (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/*
|
14
14
|
* call-seq:
|
15
|
-
* lmc.
|
15
|
+
* lmc.each_pair {|k, v| block } -> nil
|
16
16
|
*
|
17
|
-
*
|
17
|
+
* Iterates over hashtable.
|
18
18
|
*/
|
19
|
-
static VALUE
|
19
|
+
static VALUE LocalMemCache__each_pair(VALUE obj) {
|
20
20
|
</pre>
|
21
21
|
</body>
|
22
22
|
</html>
|
@@ -5,18 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>random_pair (LocalMemCache)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/*
|
14
14
|
* call-seq:
|
15
|
-
* lmc.
|
15
|
+
* lmc.random_pair() -> [key, value] or nil
|
16
16
|
*
|
17
|
-
*
|
17
|
+
* Retrieves random pair from hashtable.
|
18
18
|
*/
|
19
|
-
static VALUE
|
19
|
+
static VALUE LocalMemCache__random_pair(VALUE obj) {
|
20
20
|
</pre>
|
21
21
|
</body>
|
22
22
|
</html>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/
|
59
|
-
|
58
|
+
<a href="../../files/localmemcache_rb.html">
|
59
|
+
localmemcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|