Database Module¶
Database server module
-
class
iceprod.server.modules.db.db(*args, **kwargs)[source]¶ Handle all interaction with the local database
-
iceprod.server.modules.db.read_db_conf(field_name=None)[source]¶ Read the DB conf data from file.
Parameters: field_name (string) – (optional) field to return Returns: Either a specific field, or all fields in a dict
-
class
iceprod.server.modules.db.DBAPI(parent)[source]¶ API for database interaction
Config data (such as tables) are found at DB Config.
-
archive_tables= [u'site', u'node', u'dataset', u'dataset_notes', u'dataset_stat', u'job', u'job_stat', u'task', u'task_stat', u'task_log', u'config', u'resource', u'data']¶
-
indices= {u'search': [u'dataset_id', u'task_status', u'job_id'], u'task': [u'task_rel_id'], u'task_log': [u'task_id'], u'task_rel': [u'dataset_id'], u'job': [u'dataset_id', u'status,dataset_id'], u'task_lookup': [u'queue']}¶
-
status_options= {u'job': [u'processing', u'complete', u'suspended', u'errors'], u'task': [u'idle', u'waiting', u'queued', u'processing', u'complete', u'suspended', u'failed', u'resume', u'reset'], u'dataset': [u'processing', u'truncated', u'complete', u'suspended', u'errors']}¶
-
acquire_lock(lock_name='_none_')[source]¶ Yield a
tornado.locks.Lockfor a specific task.This is designed to be used in a context-manager:
- with (yield db.acquire_lock(‘task1’)):
- # do something
Parameters: lock_name (str) – The name of the task
-
increment_id(*args, **kwargs)[source]¶ Increment the id of a table, returning the old value.
Parameters: table_name (str) – The name of the table Returns: A table id Return type: str
-