system.interfaces.stores module

Abstract ACID store interfaces: ACID, indexed, and QEP-queryable stores.

class system.interfaces.stores.ACIDStore(persistence_layer: KeyValueStore)[source]

Bases: ABC

Interface for an ACID store

begin_transaction() → int[source]

Starts a new transaction and returns its transaction id. Also adds a new entry with metadata for this transaction in the transaction dictionary.

commit_transaction(TA_id: int) → None[source]

Commit a transaction.

Parameters:

TA_id – The id of the transaction to commit

abort_transaction(TA_id: int) → None[source]

Abort a transaction.

Parameters:

TA_id – The id of the transaction to abort

update_object(object_id: str, updated_object: object, TA_id: int) → None[source]

Update an object.

Parameters:
  • object_id – The id of the object to update

  • updated_object – The updated object

  • TA_id – The id of the transaction to update the object in

delete_object(object_id: str, TA_id: int) → None[source]

Delete an object.

Parameters:
  • object_id – The id of the object to delete

  • TA_id – The id of the transaction to delete the object in

class system.interfaces.stores.IndexedACIDStore(persistence_layer: KeyValueStore)[source]

Bases: ACIDStore, ABC

Interface for an indexed ACID store

create_index(index_name: str, attribute: str, operator: str) → None[source]

Creates an index on the store with the given name. Adds the metadata to the catalog and bulkloads the index

Parameters:
  • index_name – the name of the index

  • attribute – the attribute to create the index on

  • operator – the operator to use for the index

drop_index(index_name: str) → None[source]

Drops the index with the given name.

Parameters:

index_name – the name of the index to drop

get_suitable_indexes(attribute: str, operator: str) → Iterator[IndexProperties][source]

Returns a list of suitable indexes for the given clause.

Parameters:
  • attribute – the attribute of the clause

  • operator – the operator of the clause

Returns:

a list of suitable indexes

class system.interfaces.stores.QEPQueryableIndexedACIDStore(persistence_layer: KeyValueStore)[source]

Bases: QEPQueryable, IndexedACIDStore, ABC

Interface for a QEP-queryable indexed ACID store