system.playground.partitioning module¶
Toy train-network simulation exploring uniform load partitioning in a DBMS.
- class system.playground.partitioning.RailElement[source]¶
Bases:
ABCA rail element is either a Gate or a Platform. It has an id and can find a reachable platform.
- id_counter: int = 0¶
- class system.playground.partitioning.Gate(left: RailElement = None, right: RailElement = None)[source]¶
Bases:
RailElementA gate has a position (“left” or “right”) and two children RailElements (left and right).
- class system.playground.partitioning.Platform(visit_counter: int = 0)[source]¶
Bases:
RailElementA platform has a counter that is increased every time a train visits it.
- class system.playground.partitioning.GateTree(number_of_gate_levels: int)[source]¶
Bases:
objectA complete binary tree of gates (inner nodes) and platforms (leaves).
The tree has
number_of_gate_levelslevels of gates and therefore2 ** number_of_gate_levelsplatforms as leaves. Flat lists of all gates and all platforms are kept alongside the root for random access.