Writer¶
The Jobber class is responsible to evaluate the configuration settings and to execute the computations in parallel tasks (using the celery framework and the message queue RabbitMQ).
The writer
Module¶
Base classes for the output methods of the various codecs.
-
class
openquake.engine.writer.
CacheInserter
(dj_model, max_cache_size)[source]¶ Bases:
object
Bulk insert bunches of Django objects by converting them in strings and by using COPY FROM.
-
add
(obj)[source]¶ Parameters: obj – a Django model object Append an object to the list of objects to save. If the list exceeds the max_cache_size, flush it on the database.
-
static
array_to_pgstring
(a)[source]¶ Convert a Python list/array into the Postgres string-representation of it.
-
fields
¶ Returns the field names as introspected from the db, except the id field. The introspection is done only once per table. NB: we cannot trust the ordering in the Django model.
-
instances
= <_weakrefset.WeakSet object>¶
-