relstorage.adapters.oidallocator – IOIDAllocator implementations

IOIDAllocator implementations.

class AbstractOIDAllocator[source]

Bases: abc.ABC

These objects are intended to be stateless.

They consult an underlying database sequence than increases, and then derive additional OIDs from that sequence. new_oids returns a list of those OIDs, with the largest such OID in position 0.

class AbstractRangedOIDAllocator[source]

Bases: relstorage.adapters.oidallocator.AbstractOIDAllocator

class AbstractTableOIDAllocator(driver)[source]

Bases: relstorage.adapters.oidallocator.AbstractRangedOIDAllocator

Implements OID allocation using a table, new_oid, with an incrementing column.

new_oids(cursor)[source]

Return a sequence of new, unused OIDs.

garbage_collect_interval = 100001

After this many allocated OIDs should the (unlucky) thread that allocated the one evenly divisible by this number attempt to remove old OIDs. Set to None to disable periodic garbage collection.

keep_history = None

To use bound queries, we need to know whether we’re keeping history. It doesn’t change anything, though.