Open hq519Simplifi opened 5 years ago
Thanks for info. The data object stored in the redis db is snappy compressed , when it saved as redis backup files, is there way can use python to extract and decompress the data object if directly read the rdb files? For redis db, I can use: r = redis.Redis( ...) keys = r.randomkey() y = r.get(keys) y2 = snappy.uncompress(y) return y2
ohh. maybe implement a new callback class, that derives from the json callback class. then on each callback, do your decompression, and forward the decompressed data to the json class method.
Thanks
Hi, your question is very unclear, there's no snappy compression in redis, and i'm not sure what you want to achieve. i can only assume that you mean that the rdb file was compressed, and you want to parse it directly from the compressed form. you can do that by using the python functions (not the CLI), there's a
parse_fd
function that takes a file object, you can pass it a file like object that wraps a file object and does the decompression. if that's not what you mean, please provide more info.