def load_rdb_stream(file_name, filters=None): r = MockRedis() parser = RdbParser(r, filters) parser.parse_fd( open(os.path.join(os.path.dirname(__file__), 'dumps', file_name), 'rb')) return r
def rdb_handler(rdb): print("rdb: ", rdb) buf = io.BytesIO() callback = ProtocolCallback(out=buf) parser = RdbParser(callback) mem_fd = io.BytesIO(rdb) parser.parse_fd(mem_fd) print('rdb data', buf.getvalue()) redirect_cmd(buf.getvalue()) print("parse rdb end")
def load_rdb_stream(file_name, filters=None) : r = MockRedis() parser = RdbParser(r, filters) parser.parse_fd(open(os.path.join(os.path.dirname(__file__), 'dumps', file_name), 'rb')) return r