Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, gw_namespace=None, dir="rocksdb", compact_on_write=True, batch_write_size=1000):
"""
Create a RocksDB datastore.
Args:
gw_namespace (string) : namespace
dir (str) : directory of datastore
compact_on_write (bool)
batch_write_size (int)
"""
if gw_namespace:
j_rock_opts = config.MODULE__rocksdb_config.RocksDBOptions(gw_namespace)
else:
j_rock_opts = config.MODULE__rocksdb_config.RocksDBOptions()
if dir != "rocksdb":
j_rock_opts.setDirectory(dir)
if not compact_on_write:
j_rock_opts.setCompactOnWrite(compact_on_write)
if batch_write_size != 1000:
j_rock_opts.setBatchWriteSize(batch_write_size)
j_ds = config.MODULE__core_store.DataStoreFactory.createDataStore(j_rock_opts)
super().__init__(config.GATEWAY, j_ds)
def __init__(self, gw_namespace=None, dir="rocksdb", compact_on_write=True, batch_write_size=1000):
"""
Create a RocksDB datastore.
Args:
gw_namespace (string) : namespace
dir (str) : directory of datastore
compact_on_write (bool)
batch_write_size (int)
"""
if gw_namespace:
j_rock_opts = config.MODULE__rocksdb_config.RocksDBOptions(gw_namespace)
else:
j_rock_opts = config.MODULE__rocksdb_config.RocksDBOptions()
if dir != "rocksdb":
j_rock_opts.setDirectory(dir)
if not compact_on_write:
j_rock_opts.setCompactOnWrite(compact_on_write)
if batch_write_size != 1000:
j_rock_opts.setBatchWriteSize(batch_write_size)
j_ds = config.MODULE__core_store.DataStoreFactory.createDataStore(j_rock_opts)
super().__init__(config.GATEWAY, j_ds)