Jedis and NessDB

119 views
Skip to first unread message

Loïc

unread,
May 7, 2012, 9:55:54 AM5/7/12
to nessDB
Hello,

I would like to include NessDB in a computation software written in
Java that already use other Key-Value databases (Kyoto, Redis, HashMap
Java...).

I use Redis client Jedis to connect to NessDB server.
Keys are String (convert in byte[]) and Value are Object (convert in
byte[] with Google Protobuffer).
After some GET/SET operations, I got a ProtoBuff error because value
from GET cannot be deserialize by protobuf.
It seems that, with Jedis and NessDB, data are not well processed/
transfer or store.

I'have try with a simple example which put the byte[] built from
string "helloworld" instead of my data for every key.

In a SET:
jedis.set(key,"helloworld".getBytes());

In a GET:
byte[] value = jedis.get(key);
String printValue = value!=null ? new String(value) : null;
System.out.println("GET:"+new String(key) + " => " + printValue);


With this implementation, I have:
GET:1#14811020 => helloworld
GET:1#14c1102a => null
GET:1#17810021 => null
GET:1#110100a8 => helloworld
[...]
GET:1#171701ba => null
GET:1#171500aa => helloworldq[]
GET:1#4851122 => helloworld
GET:1#d5112a => null
GET:1#5501bb => null
[...]
GET:1#169501ab => helloworldu[]
GET:1#6d511a1 => null
GET:1#16d501bb => null
GET:1#10020 => helloworldu[]
[...]

([] is a special rectangle char)

I try to visualise the history of key: "1#171500aa".
The first part of my software makes read/write (in my "dummy" example:
if read = null then write data)
Second part is just Read. Data are not modify!

-----------READ/WRITE part------
GET:1#171500aa => null
SET:key 1#171500aa value helloworld
(My software won't update this key/value but makes a lot of other read/
write in other key/value.

-----------JUST READ part-------
GET:1#171500aa => helloworld
GET:1#171500aa => helloworld
GET:1#171500aa => helloworldu[]
GET:1#171500aa => helloworldu[]
GET:1#171500aa => helloworldt[]
[...]
GET:1#171500aa => helloworldq[]
GET:1#171500aa => helloworld
[...]

I don't understand why jedis/nessdb gives me "dirty" values. Sometimes
GET gives me good value, sometimes not.

Is there anyone here who try to use NessDB with Jedis?

Thanks!

BohuTANG

unread,
May 7, 2012, 9:05:13 PM5/7/12
to nes...@googlegroups.com
Hi,
I never use Jedis to test nessDB server(just used official redis-cli)
But i think it's the '\0' of the key/values end, you can add 'request_dump' in db-server.c to dump the argvs which from your Jedis.
Welcome to give me issues on github.
Thanks.

Loïc

unread,
May 8, 2012, 2:52:37 AM5/8/12
to nessDB
Hi,

Thanks for your reply.
I print request_dump and the return value.
I write log details in the github issue: https://github.com/shuttler/nessDB/issues/43

Thanks,
Loïc
Reply all
Reply to author
Forward
0 new messages