示例#1
0
    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
示例#2
0
    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
示例#3
0
    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
示例#4
0
    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
示例#5
0
 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
示例#6
0
 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
示例#7
0
 def deserialize(cls, bytes, offset):
     return ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
示例#8
0
 def deserialize(cls, bytes, offset):
     data, offset = read_buffer(bytes, offset)
     stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
     return data, stat
示例#9
0
 def deserialize(cls, bytes, offset):
     stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
     return stat if stat.czxid != -1 else None
示例#10
0
 def deserialize(cls, bytes, offset):
     data, offset = read_buffer(bytes, offset)
     stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
     return data, stat
示例#11
0
 def deserialize(cls, bytes, offset):
     return ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
示例#12
0
 def deserialize(cls, bytes, offset):
     stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
     return stat if stat.czxid != -1 else None
示例#13
0
 def deserialize(cls, bytes, offset):
     path, offset = read_string(bytes, offset)
     stat = ZnodeStat._make(stat_struct.unpack_from(bytes, offset))
     return path, stat