kdr2 / redis-leveldb Goto Github PK
View Code? Open in Web Editor NEWA redis-protocol compatible frontend to google's leveldb
License: MIT License
A redis-protocol compatible frontend to google's leveldb
License: MIT License
Cool project! Any benchmarks?
这个项目真的非常好,打算用它来替换redis。
请问Redis其他的命令比如hincr/hincrby和sorted set类型后面会支持吗?
This is a little example as a "proof of bug" In normal redis this command (r_serv.scard("i")) would return a "0" if not existing: http://redis.io/commands/scard
In [1]: import redis
In [3]: r_serv = redis.StrictRedis("127.0.0.1", 8323, 10)
In [4]: r_serv.smembers("i")
Out[4]: set([])
In [5]: r_serv.scard("i")
TypeError Traceback (most recent call last)
in ()
----> 1 r_serv.scard("i")
/usr/local/lib/python2.7/dist-packages/redis/client.pyc in scard(self, name)
1250 def scard(self, name):
1251 "Return the number of elements in set name
"
-> 1252 return self.execute_command('SCARD', name)
1253
1254 def sdiff(self, keys, *args):
/usr/local/lib/python2.7/dist-packages/redis/client.pyc in execute_command(self, _args, *_options)
459 try:
460 connection.send_command(_args)
--> 461 return self.parse_response(connection, command_name, *_options)
462 except ConnectionError:
463 connection.disconnect()
/usr/local/lib/python2.7/dist-packages/redis/client.pyc in parse_response(self, connection, command_name, *_options)
471 response = connection.read_response()
472 if command_name in self.response_callbacks:
--> 473 return self.response_callbacks command_name (response, *_options)
474 return response
475
TypeError: int() argument must be a string or a number, not 'NoneType'
cd src && make all
make[1]: “/home/test/Downloads/redis-leveldb-1.4/src”
g++ -Wall -I/usr/include -I/usr/include -I../vendor/leveldb/include -c -o rl_util.o rl_util.cpp
In file included from rl_util.cpp:22:
rl_server.h:14:10: fatal error: ev.h: Not Found
#include <ev.h>
^~~~~~
compilation terminated.
ev.h and leveldb/c.h not in code ?how to run this project
Hi
I use redis-leveldb with pyredis. I noticed that the encoding is wrong for sadd statements but good for others. Here is the code:
leveldb_con = redis.StrictRedis(host=leveldb_host, port=leveldb_port, db=0, charset='utf-8')
pipe = leveldb_con.pipeline(transaction=False)
key='toto'
val=9999
skey='tutu'
sval='127.0.0.1'
pipe.set(key, val)
pipe.sadd(skey, sval)
pipe.execute()
And the output:
127.0.0.1:8324> KEYS *
1) "\x02\x03size\x04tutu"
2) "\x03\x04tutu\t127.0.0.1"
3) "toto"
127.0.0.1:8324>
I am wondering if I missed something of if it is a known bug?
(error) ERR redis-leveldb is running in single-db mode
但是我已经使用了multiple模式,数据库目录也已经生成了。
During our batch imports redis-leveldb goes 100% CPU, not even a restart helps. Before that (or maybe unrelated - not sure) it throws a lot of these:
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_S_create
I do not know any C/C++. How could I help debug this error?
got this error during a consecutive delete and set
After a period of time of executing these commands I get a segfault
key = "test"
for (i = 0; i< 100; i++) {
conn.delete(key)
conn.set(key, "test")
}
Note: multiple threads
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_S_create
Program received signal SIGABRT, Aborted.
[Switching to Thread 801c07400 (LWP 100406/redis-leveldb)]
0x00000008016e0a7c in thr_kill () from /lib/libc.so.7
(gdb)
(gdb) bt
#0 0x00000008016e0a7c in thr_kill () from /lib/libc.so.7
#1 0x000000080177dd3b in abort () from /lib/libc.so.7
#2 0x0000000800fc4c94 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#3 0x0000000800fc9193 in std::set_unexpected () from /usr/lib/libstdc++.so.6
#4 0x0000000800fc91d3 in std::terminate () from /usr/lib/libstdc++.so.6
#5 0x0000000800fc913a in __cxa_throw () from /usr/lib/libstdc++.so.6
#6 0x000000080101a972 in std::__throw_length_error () from /usr/lib/libstdc++.so.6
#7 0x0000000800fca5d9 in std::string::_Rep::_S_create () from /usr/lib/libstdc++.so.6
#8 0x0000000800fcb305 in std::string::_S_copy_chars () from /usr/lib/libstdc++.so.6
#9 0x0000000800fcb4ba in std::basic_string<char, std::char_traits, std::allocator >::basic_string () from /usr/lib/libstdc++.so.6
#10 0x00000000004072fe in RLConnection::do_read ()
#11 0x0000000000407739 in RLConnection::on_readable ()
#12 0x00000008008aac52 in ev_invoke_pending (loop=0x801c6f600) at ev.c:2994
#13 0x00000008008af37c in ev_run (loop=0x801c6f600, flags=Variable "flags" is not available.
) at ev.c:3394
#14 0x00000000004049fb in RLServer::start ()
👋 Just found this repo does not have any license, it would be good to add OSI-approved one, https://spdx.org/licenses/
Some popular license choice would be:
For your information,
It would be wise to include snappy in LDFLAGS for all the operating systems:
LDFLAGS += -lsnappy ../vendor/libleveldb.a -lm -L$(LIBEV)/lib -lev -L$(GMP)/lib -lgmp
and not only Darwin. As the snappy compression library is required for LevelDB linking.
Thank you very much for your work.
这个项目非常的酷,我非常喜欢,从年初开始使用。
看到最近增加了hash,set,list,等功能。此前我使用的是将一个object用msgpack后,然后存储为一个kv类型的值,然后在取出时,再decode。
现在有了hash,set,list之后,我的代码可以简化,但是不知道hash、set、list的空间占用是怎样计算的?
Is there a way to use something like the sort() command or a workaround?
Actually I would not like to load all the 10k+ items into my nodejs to fetch 10 with the highest value.
Or any tips on that?
When a request that's too big to fit in the buffer is issued RLConnection::on_readable will livelock.
I can propose a fix for this issue by using a growing buffer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.