Beispiel #1
0
 def interpret_key(cls, key):
     uuid, treepath, entryrange, form_key, *layoutattr = key_to_tuple(key)
     start, stop = (int(x) for x in entryrange.split("-"))
     nodes = form_key.split(",")
     if len(layoutattr) == 1:
         nodes.append("!" + layoutattr[0])
     elif len(layoutattr) > 1:
         raise RuntimeError(f"Malformed key: {key}")
     return uuid, treepath, start, stop, nodes
Beispiel #2
0
 def __len__(self):
     uuid, treepath, entryrange = key_to_tuple(self._partition_key)
     start, stop = (int(x) for x in entryrange.split("-"))
     return stop - start
Beispiel #3
0
 def __setitem__(self, key, value):
     key = key_to_tuple(key)[4]
     key = key.split(",")[0]
     self.accessed.append(key)
     weakref.finalize(value, self.finalized.append, key)