def deserialize(cls, bytes, offset): count = int_struct.unpack_from(bytes, offset)[0] offset += int_struct.size if count == -1: # pragma: nocover return [] children = [] for c in range(count): child, offset = read_string(bytes, offset) children.append(child) stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) return children, stat
def deserialize(cls, bytes, offset): count = int_struct.unpack_from(bytes, offset)[0] offset += int_struct.size if count == -1: # pragma: nocover return [] acls = [] for c in range(count): acl, offset = read_acl(bytes, offset) acls.append(acl) stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) return acls, stat
def deserialize(cls, bytes, offset): header = MultiHeader(None, False, None) results = [] response = None while not header.done: if header.type == Create.type: response, offset = read_string(bytes, offset) elif header.type == Delete.type: response = True elif header.type == SetData.type: response = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) offset += stat_struct.size elif header.type == CheckVersion.type: response = True elif header.type == -1: err = int_struct.unpack_from(bytes, offset)[0] offset += int_struct.size response = EXCEPTIONS[err]() if response: results.append(response) header, offset = MultiHeader.deserialize(bytes, offset) return results
def deserialize(cls, bytes, offset): header = MultiHeader(None, False, None) results = [] response = None while not header.done: if header.type == Create.type: response, offset = read_string(bytes, offset) elif header.type == Delete.type: response = True elif header.type == SetData.type: response = ZnodeStat._make( stat_struct.unpack_from(bytes, offset)) offset += stat_struct.size elif header.type == CheckVersion.type: response = True elif header.type == -1: err = int_struct.unpack_from(bytes, offset)[0] offset += int_struct.size response = EXCEPTIONS[err]() if response: results.append(response) header, offset = MultiHeader.deserialize(bytes, offset) return results
def deserialize(cls, bytes, offset): return ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
def deserialize(cls, bytes, offset): data, offset = read_buffer(bytes, offset) stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) return data, stat
def deserialize(cls, bytes, offset): stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) return stat if stat.czxid != -1 else None
def deserialize(cls, bytes, offset): path, offset = read_string(bytes, offset) stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset)) return path, stat