airflow.providers.google.leveldb.hooks.leveldb¶
Hook for Level DB
Module Contents¶
-
exception
airflow.providers.google.leveldb.hooks.leveldb.LevelDBHookException[source]¶ Bases:
airflow.exceptions.AirflowExceptionException specific for LevelDB
-
class
airflow.providers.google.leveldb.hooks.leveldb.LevelDBHook(leveldb_conn_id: str = default_conn_name)[source]¶ Bases:
airflow.hooks.base.BaseHookPlyvel Wrapper to Interact With LevelDB Database LevelDB Connection Documentation
-
get_conn(self, name: str = '/tmp/testdb/', create_if_missing: bool = False, **kwargs)[source]¶ Creates Plyvel DB
-
run(self, command: str, key: bytes, value: bytes = None, keys: List[bytes] = None, values: List[bytes] = None)[source]¶ Execute operation with leveldb
- Parameters
command (str) -- command of plyvel(python wrap for leveldb) for DB object e.g.
"put","get","delete","write_batch".key (bytes) -- key for command(put,get,delete) execution(, e.g.
b'key',b'another-key')value (bytes) -- value for command(put) execution(bytes, e.g.
b'value',b'another-value')keys (List[bytes]) -- keys for command(write_batch) execution(List[bytes], e.g.
[b'key', b'another-key'])values (List[bytes]) -- values for command(write_batch) execution e.g.
[b'value',b'another-value']
- Returns
value from get or None
- Return type
Optional[bytes]
-