metaStorage¶
meta storage for macsserver¶
author: | Tobias Kölling |
---|
The meta storage provides an abstraction for a database used to store metadata about the processing of raw data to products.
Current backend implementations include:
DictMetaStorage
: Using a pythondict
as in-memory storage. This storage can only be used in one process and looses all contents after program termination. It is useful for e.g. for unittests.LevelDBMetaStorage
: Using a LevelDB as on-disk storage. This storage can only be used in one process at a time, but keeps information after program termination. It is intended for interactive testing.MongoDBMetaStorage
: Using a MongoDB as storage. This storage can be used by multiple processes concurrently and is intended for production use.
-
class
runmacs.processor.metaStorage.
EnhancedIterable
(it)[source]¶ Iterable which behaves more like a MongoDB-Cursor.
-
class
runmacs.processor.metaStorage.
KVBaseMetaStorage
[source]¶ Base class for MetaStorage using key-value based backends.
-
class
runmacs.processor.metaStorage.
LevelDBMetaStorage
(path)[source]¶ MetaStorage with LevelDB backend.
-
class
runmacs.processor.metaStorage.
MetaStorage
[source]¶ Base class for every meta storage implementation.
-
class
runmacs.processor.metaStorage.
MongoDBMetaStorage
(url, dbname='macsServer')[source]¶ MetaStorage with MongoDB backend.
-
runmacs.processor.metaStorage.
enhancedFilter
(query, it)[source]¶ Filters many datasets using a
query
.Creates an
EnhancedIterable
from and iterable of mongodb-like datasets. The result will only contain datasets which match the givenquery
.Parameters: - query – A mongodb-style query.
- it – An iterable over dict/list trees representing mongodb-like data.
Returns: An
EnhancedIterable
with matching datasets only.