Swarm-NG
1.1
|
Interface to BDB log files. More...
Public Member Functions | |
def | __init__ |
Opens a BDB file that contains the primary database and secondary indices. More... | |
def | getMetadata |
Get meta data from the database for the provided name string. More... | |
def | all_records |
Return an iterable for all of the records, the records are sorted by time, then event id then system id. More... | |
def | time_sequence |
Returns a iterable of times for a time range, it is used for making range queries. More... | |
def | system_range_records |
Query for all the records that have system id in the system range. More... | |
def | time_range_records |
Query for all the records that have time in the time range. More... | |
def | system_at_time |
Query for all the records for a system in a given time range. More... | |
def | initial_conditions |
Return initial coniditions for the system range. More... | |
def | final_conditions |
Return the final conditions for a range of systems that is the largest time for which the system has a valid entry. More... | |
def | query |
Query the database for with a time range ,system range and event id range. More... | |
Static Public Attributes | |
string | fileFormatVersion = "1" |
Supported version of BDB log files. | |
Interface to BDB log files.
open a log file like:
Note that most of the methods below return key-value pairs. The key-value pair is a Python tuple where the first element is of type PKey and has time, system_id, event_id properties. the second element is a LogRecord object and contains all the information about the planetary system and its attributes.
def swarmng.logdb.IndexedLogDB.__init__ | ( | self, | |
pathName | |||
) |
Opens a BDB file that contains the primary database and secondary indices.
fn:
path to the database file name Definition at line 189 of file logdb.py.
References swarm::log::bdb_database.event_idx, swarmng.logdb.IndexedLogDB.event_idx, swarm::log::bdb_database.metadata, swarmng.logdb.IndexedLogDB.metadata, swarm::log::bdb_database.primary, swarmng.logdb.IndexedLogDB.primary, swarm::log::bdb_database.system_idx, swarmng.logdb.IndexedLogDB.system_idx, swarm::log::bdb_database.time_idx, swarmng.logdb.IndexedLogDB.time_idx, swarm::log::bdb_database.validateVersionInfo(), and swarmng.logdb.IndexedLogDB.validateVersionInfo().
def swarmng.logdb.IndexedLogDB.all_records | ( | self) |
def swarmng.logdb.IndexedLogDB.final_conditions | ( | self, | |
system_range | |||
) |
Return the final conditions for a range of systems that is the largest time for which the system has a valid entry.
Return an iterable of a tuple of system id and LogRecord.
Usage:
def swarmng.logdb.IndexedLogDB.getMetadata | ( | self, | |
name | |||
) |
Get meta data from the database for the provided name
string.
There are two metadata that are always available: fileFormatVersion
and swarmngVersion
Meta data for the log file is a mapping of string -> string.
name
: string :name of the property we are looking for. returns : string value for the provided property, None if the property is not found. Definition at line 241 of file logdb.py.
References swarmng.logdb.IndexedLogDB.fileFormatVersion, and swarmng.logdb.IndexedLogDB.getMetadata().
Referenced by swarmng.logdb.IndexedLogDB.getMetadata().
def swarmng.logdb.IndexedLogDB.initial_conditions | ( | self, | |
system_range | |||
) |
Return initial coniditions for the system range.
Return an iterable of a tuple of system id and LogRecord.
Usage:
def swarmng.logdb.IndexedLogDB.query | ( | d, | |
tr, | |||
sr, | |||
er | |||
) |
Query the database for with a time range ,system range and event id range.
Return an iterable of key-value pairs.
def swarmng.logdb.IndexedLogDB.system_at_time | ( | self, | |
sysid, | |||
time_range | |||
) |
def swarmng.logdb.IndexedLogDB.system_range_records | ( | self, | |
sys_range | |||
) |
def swarmng.logdb.IndexedLogDB.time_range_records | ( | self, | |
time_range | |||
) |
def swarmng.logdb.IndexedLogDB.time_sequence | ( | self, | |
time_range | |||
) |