swh.objstorage.backends.winery.sharedbase module#
- class swh.objstorage.backends.winery.sharedbase.ShardState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum
- STANDBY = 'standby'#
- WRITING = 'writing'#
- FULL = 'full'#
- PACKING = 'packing'#
- PACKED = 'packed'#
- READONLY = 'readonly'#
- property locked#
- property readonly_available#
- class swh.objstorage.backends.winery.sharedbase.SharedBase(**kwargs)[source]#
Bases:
Database
- property lock#
Return an arbitrary unique number for pg_advisory_lock when creating tables
- property database_tables#
Return the list of CREATE TABLE statements for all tables in the database
- lock_one_shard(current_state: ShardState, new_state: ShardState) → Tuple[str, int] | None[source]#
Lock one shard in current_state, putting it into new_state