Question

I got a key like this: "\x04y\x03\x00\x00K" from my redis, and I totally confused about its meaning.

Are "\x04" represents for a hex string and "y" stands for a ascii char? Is so, why does the key combine both?

Thx in advance.

edit: I am using Jedis(a java client for redis) and make key as byte arrays. My codes(in java) are some like this:

jedis.set(aByteArr, value)

While running the code, I opened the native client provided by redis, executing "MONITOR" command to see what key is actually being saved in redis. And this is what I have found:

... SET "\x04y\x03\x00\x00K" "aString"

Était-ce utile?

La solution

\x represents a hex char escape. So the byte array key is encoded in a hex characters sequence in redis.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top