Object Document Mapper
Description
The module contains the object document map for the MongoDB collections and they python portion of the toolchain.
Documents
runner.odm
ODM for the RLITT generator.
StencilStateEnum
Bases: int, Enum
The enum for states a stencil can occupy.
Attributes:
| Name | Type | Description |
|---|---|---|
new |
The stencil is new. |
|
started |
The stencil is being processed. |
|
no_headroom |
The stencil is fully processed but jobs are not yet created. |
|
complete |
The stencil is fully processed. |
StencilCfg
dataclass
StencilCfg(current_completed_tcn, max_tcn, _id)
The configuration document for the stencil store.
Attributes:
| Name | Type | Description |
|---|---|---|
current_completed_tcn |
int
|
The current largest TCN to be fully generated. |
max_tcn |
int
|
The maximum TCN to process. |
_id |
str
|
The ID for the document. |
StencilDB
dataclass
StencilDB(_id, rootstock_tcn, scion_tcn, state)
The shape of a stencil document.
Attributes:
| Name | Type | Description |
|---|---|---|
_id |
ObjectId
|
The ID for the document. |
rootstock_tcn |
int
|
The TCN for the rootstock of the stencil. |
scion_tcn |
int
|
The TCN for the scion of the stencil. |
state |
int
|
The state of the stencil. This is in terms of StencilStateEnum. |
cursor |
int
|
The current cursor, a pair of ObjectId for arborescent tangle documents. |
get_db
get_db(url, port, username, password, database_name)
Get a connection to the mongodb.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
The domain to connect to. |
required |
port
|
int
|
The port to connect to. |
required |
username
|
str
|
The username to use for the connection. |
required |
password
|
str
|
The password to use for the connection. |
required |
database_name
|
str
|
The name of the database to connect to. |
required |
Returns:
| Type | Description |
|---|---|
Database
|
Returns one of a database connection or None. |
Source code in runner/odm.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
get_stencil_collection
get_stencil_collection(dbc)
Get the stencil collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dbc
|
Database
|
The mongodb to get the collection from. |
required |
Returns:
| Type | Description |
|---|---|
Collection
|
A connection to the stencil collection. |
Source code in runner/odm.py
42 43 44 45 46 47 48 49 50 51 | |
get_arborescent_collection
get_arborescent_collection(dbc)
Get the arborescent tangle collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dbc
|
Database
|
The mongodb to get the collection from. |
required |
Returns:
| Type | Description |
|---|---|
Collection
|
A connection to the arborescent collection. |
Source code in runner/odm.py
54 55 56 57 58 59 60 61 62 63 | |