decisionengine.framework.dataspace.datasources package

Subpackages

Submodules

decisionengine.framework.dataspace.datasources.null module

class decisionengine.framework.dataspace.datasources.null.NullDataSource(config_dict)[source]

Bases: DataSource

Implementation of data source ABC that does nothing

_abc_impl = <_abc._abc_data object>
close()[source]

Close all connections to the database

connect()[source]

Create a pool of database connections

create_tables()[source]

Create database tables

delete_data_older_than(days)[source]

Delete data older that interval :type days: long :arg days: remove data older than interval

duplicate_datablock(taskmanager_id, generation_id, new_generation_id)[source]

For the given taskmanager_id, make a copy of the datablock with given generation_id, set the generation_id for the datablock copy

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • new_generation_id (int) – generation_id of the new datablock created

get_datablock(taskmanager_id, generation_id)[source]

Return the entire datablock from the dataproduct table for the given taskmanager_id, generation_id

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

get_dataproduct(taskmanager_id, generation_id, key)[source]

Return the data from the dataproduct table for the given taskmanager_id, generation_id, key

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • key (string) – key for the value

get_dataproducts(taskmanager_id, key=None)[source]

Return list of all data products associated with with taskmanager_id

Parameters:

key (string) – data product key

get_header(taskmanager_id, generation_id, key)[source]

Return the header from the header table for the given taskmanager_id, generation_id, key

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • key (string) – key for the value

get_last_generation_id(taskmanager_name, taskmanager_id=None)[source]

Return last generation id for current task manager or taskmanager w/ task_manager_id.

Parameters:
  • taskmanager_name (string) – task manager name

  • taskmanager_id (string) – task manager id

get_metadata(taskmanager_id, generation_id, key)[source]

Return the metadata from the metadata table for the given taskmanager_id, generation_id, key

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • key (string) – key for the value

get_schema(table=None)[source]

Given the table name return it’s schema

Parameters:

table (string) – Name of the table

get_taskmanager(taskmanager_name, taskmanager_id=None)[source]

Retrieve TaskManager :type taskmanager_name: string :arg taskmanager_name: name of taskmanager to retrieve :type taskmanager_id: string :arg taskmanager_id: id of taskmanager to retrieve

get_taskmanagers(taskmanager_name=None, start_time=None, end_time=None)[source]

Retrieve TaskManagers :type taskmanager_name: string :arg taskmanager_name: name of taskmanager to retrieve :type taskmanager_id: string :arg taskmanager_id: id of taskmanager to retrieve

insert(taskmanager_id, generation_id, key, value, header, metadata)[source]

Insert data into respective tables for the given taskmanager_id, generation_id, key

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • key (string) – key for the value

  • value (object) – Value can be an object or dict

  • header (Header) – Header for the value

  • header – Metadata for the value

reset_connections()[source]

Drop any cached connections and reconnect to the database

store_taskmanager(name, taskmanager_id, datestamp=None)[source]

Store TaskManager :type taskmanager_name: string :arg taskmanager_name: name of taskmanager to retrieve :type taskmanager_id: string :arg taskmanager_id: id of taskmanager to retrieve :type datestamp: datetime :arg datestamp: datetime of created object, defaults to ‘now’

update(taskmanager_id, generation_id, key, value, header, metadata)[source]

Update the data in respective tables for the given taskmanager_id, generation_id, key

Parameters:
  • taskmanager_id (string) – taskmanager_id for generation to be retrieved

  • generation_id (int) – generation_id of the data

  • key (string) – key for the value

  • value (object) – Value can be an object or dict

  • header (Header) – Header for the value

  • header – Metadata for the value

Module contents