mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-04 16:38:52 +01:00
Remove all tracing::instrument attributes from database::abstraction::*
This commit is contained in:
parent
accdb77315
commit
0ad6eac4f8
4 changed files with 0 additions and 34 deletions
|
@ -69,7 +69,6 @@ impl DatabaseEngine for Engine {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EngineTree {
|
impl EngineTree {
|
||||||
#[tracing::instrument(skip(self, tree, from, backwards))]
|
|
||||||
fn iter_from_thread(
|
fn iter_from_thread(
|
||||||
&self,
|
&self,
|
||||||
tree: Arc<heed::UntypedDatabase>,
|
tree: Arc<heed::UntypedDatabase>,
|
||||||
|
@ -94,7 +93,6 @@ impl EngineTree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(tree, txn, from, backwards))]
|
|
||||||
fn iter_from_thread_work(
|
fn iter_from_thread_work(
|
||||||
tree: Arc<heed::UntypedDatabase>,
|
tree: Arc<heed::UntypedDatabase>,
|
||||||
txn: &heed::RoTxn<'_>,
|
txn: &heed::RoTxn<'_>,
|
||||||
|
@ -126,7 +124,6 @@ fn iter_from_thread_work(
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tree for EngineTree {
|
impl Tree for EngineTree {
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
||||||
let txn = self.engine.env.read_txn().map_err(convert_error)?;
|
let txn = self.engine.env.read_txn().map_err(convert_error)?;
|
||||||
Ok(self
|
Ok(self
|
||||||
|
@ -136,7 +133,6 @@ impl Tree for EngineTree {
|
||||||
.map(|s| s.to_vec()))
|
.map(|s| s.to_vec()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key, value))]
|
|
||||||
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
||||||
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
||||||
self.tree
|
self.tree
|
||||||
|
@ -147,7 +143,6 @@ impl Tree for EngineTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn remove(&self, key: &[u8]) -> Result<()> {
|
fn remove(&self, key: &[u8]) -> Result<()> {
|
||||||
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
||||||
self.tree.delete(&mut txn, &key).map_err(convert_error)?;
|
self.tree.delete(&mut txn, &key).map_err(convert_error)?;
|
||||||
|
@ -155,12 +150,10 @@ impl Tree for EngineTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self))]
|
|
||||||
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + Send + 'a> {
|
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + Send + 'a> {
|
||||||
self.iter_from(&[], false)
|
self.iter_from(&[], false)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, from, backwards))]
|
|
||||||
fn iter_from(
|
fn iter_from(
|
||||||
&self,
|
&self,
|
||||||
from: &[u8],
|
from: &[u8],
|
||||||
|
@ -169,7 +162,6 @@ impl Tree for EngineTree {
|
||||||
self.iter_from_thread(Arc::clone(&self.tree), from.to_vec(), backwards)
|
self.iter_from_thread(Arc::clone(&self.tree), from.to_vec(), backwards)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
||||||
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
let mut txn = self.engine.env.write_txn().map_err(convert_error)?;
|
||||||
|
|
||||||
|
@ -186,7 +178,6 @@ impl Tree for EngineTree {
|
||||||
Ok(new)
|
Ok(new)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn scan_prefix<'a>(
|
fn scan_prefix<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
prefix: Vec<u8>,
|
prefix: Vec<u8>,
|
||||||
|
@ -197,7 +188,6 @@ impl Tree for EngineTree {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
||||||
self.watchers.watch(prefix)
|
self.watchers.watch(prefix)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ impl PersyTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tree for PersyTree {
|
impl Tree for PersyTree {
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
||||||
let result = self
|
let result = self
|
||||||
.persy
|
.persy
|
||||||
|
@ -72,14 +71,12 @@ impl Tree for PersyTree {
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key, value))]
|
|
||||||
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
||||||
self.insert_batch(&mut Some((key.to_owned(), value.to_owned())).into_iter())?;
|
self.insert_batch(&mut Some((key.to_owned(), value.to_owned())).into_iter())?;
|
||||||
self.watchers.wake(key);
|
self.watchers.wake(key);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, iter))]
|
|
||||||
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
||||||
let mut tx = self.begin()?;
|
let mut tx = self.begin()?;
|
||||||
for (key, value) in iter {
|
for (key, value) in iter {
|
||||||
|
@ -93,7 +90,6 @@ impl Tree for PersyTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, iter))]
|
|
||||||
fn increment_batch<'a>(&self, iter: &mut dyn Iterator<Item = Vec<u8>>) -> Result<()> {
|
fn increment_batch<'a>(&self, iter: &mut dyn Iterator<Item = Vec<u8>>) -> Result<()> {
|
||||||
let mut tx = self.begin()?;
|
let mut tx = self.begin()?;
|
||||||
for key in iter {
|
for key in iter {
|
||||||
|
@ -108,7 +104,6 @@ impl Tree for PersyTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn remove(&self, key: &[u8]) -> Result<()> {
|
fn remove(&self, key: &[u8]) -> Result<()> {
|
||||||
let mut tx = self.begin()?;
|
let mut tx = self.begin()?;
|
||||||
tx.remove::<ByteVec, ByteVec>(&self.name, ByteVec::from(key), None)?;
|
tx.remove::<ByteVec, ByteVec>(&self.name, ByteVec::from(key), None)?;
|
||||||
|
@ -116,7 +111,6 @@ impl Tree for PersyTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self))]
|
|
||||||
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + 'a> {
|
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + 'a> {
|
||||||
let iter = self.persy.range::<ByteVec, ByteVec, _>(&self.name, ..);
|
let iter = self.persy.range::<ByteVec, ByteVec, _>(&self.name, ..);
|
||||||
match iter {
|
match iter {
|
||||||
|
@ -132,7 +126,6 @@ impl Tree for PersyTree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, from, backwards))]
|
|
||||||
fn iter_from<'a>(
|
fn iter_from<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
from: &[u8],
|
from: &[u8],
|
||||||
|
@ -165,13 +158,11 @@ impl Tree for PersyTree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
||||||
self.increment_batch(&mut Some(key.to_owned()).into_iter())?;
|
self.increment_batch(&mut Some(key.to_owned()).into_iter())?;
|
||||||
Ok(self.get(key)?.unwrap())
|
Ok(self.get(key)?.unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn scan_prefix<'a>(
|
fn scan_prefix<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
prefix: Vec<u8>,
|
prefix: Vec<u8>,
|
||||||
|
@ -200,7 +191,6 @@ impl Tree for PersyTree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
||||||
self.watchers.watch(prefix)
|
self.watchers.watch(prefix)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ impl Tree for SledEngineTree {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, iter))]
|
|
||||||
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
||||||
for (key, value) in iter {
|
for (key, value) in iter {
|
||||||
self.0.insert(key, value)?;
|
self.0.insert(key, value)?;
|
||||||
|
|
|
@ -134,7 +134,6 @@ pub struct SqliteTable {
|
||||||
type TupleOfBytes = (Vec<u8>, Vec<u8>);
|
type TupleOfBytes = (Vec<u8>, Vec<u8>);
|
||||||
|
|
||||||
impl SqliteTable {
|
impl SqliteTable {
|
||||||
#[tracing::instrument(skip(self, guard, key))]
|
|
||||||
fn get_with_guard(&self, guard: &Connection, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
fn get_with_guard(&self, guard: &Connection, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
||||||
//dbg!(&self.name);
|
//dbg!(&self.name);
|
||||||
Ok(guard
|
Ok(guard
|
||||||
|
@ -143,7 +142,6 @@ impl SqliteTable {
|
||||||
.optional()?)
|
.optional()?)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, guard, key, value))]
|
|
||||||
fn insert_with_guard(&self, guard: &Connection, key: &[u8], value: &[u8]) -> Result<()> {
|
fn insert_with_guard(&self, guard: &Connection, key: &[u8], value: &[u8]) -> Result<()> {
|
||||||
//dbg!(&self.name);
|
//dbg!(&self.name);
|
||||||
guard.execute(
|
guard.execute(
|
||||||
|
@ -192,12 +190,10 @@ impl SqliteTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tree for SqliteTable {
|
impl Tree for SqliteTable {
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
|
||||||
self.get_with_guard(self.engine.read_lock(), key)
|
self.get_with_guard(self.engine.read_lock(), key)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key, value))]
|
|
||||||
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
fn insert(&self, key: &[u8], value: &[u8]) -> Result<()> {
|
||||||
let guard = self.engine.write_lock();
|
let guard = self.engine.write_lock();
|
||||||
self.insert_with_guard(&guard, key, value)?;
|
self.insert_with_guard(&guard, key, value)?;
|
||||||
|
@ -206,7 +202,6 @@ impl Tree for SqliteTable {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, iter))]
|
|
||||||
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
fn insert_batch<'a>(&self, iter: &mut dyn Iterator<Item = (Vec<u8>, Vec<u8>)>) -> Result<()> {
|
||||||
let guard = self.engine.write_lock();
|
let guard = self.engine.write_lock();
|
||||||
|
|
||||||
|
@ -221,7 +216,6 @@ impl Tree for SqliteTable {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, iter))]
|
|
||||||
fn increment_batch<'a>(&self, iter: &mut dyn Iterator<Item = Vec<u8>>) -> Result<()> {
|
fn increment_batch<'a>(&self, iter: &mut dyn Iterator<Item = Vec<u8>>) -> Result<()> {
|
||||||
let guard = self.engine.write_lock();
|
let guard = self.engine.write_lock();
|
||||||
|
|
||||||
|
@ -239,7 +233,6 @@ impl Tree for SqliteTable {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn remove(&self, key: &[u8]) -> Result<()> {
|
fn remove(&self, key: &[u8]) -> Result<()> {
|
||||||
let guard = self.engine.write_lock();
|
let guard = self.engine.write_lock();
|
||||||
|
|
||||||
|
@ -251,14 +244,12 @@ impl Tree for SqliteTable {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self))]
|
|
||||||
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = TupleOfBytes> + 'a> {
|
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = TupleOfBytes> + 'a> {
|
||||||
let guard = self.engine.read_lock_iterator();
|
let guard = self.engine.read_lock_iterator();
|
||||||
|
|
||||||
self.iter_with_guard(guard)
|
self.iter_with_guard(guard)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, from, backwards))]
|
|
||||||
fn iter_from<'a>(
|
fn iter_from<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
from: &[u8],
|
from: &[u8],
|
||||||
|
@ -323,7 +314,6 @@ impl Tree for SqliteTable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, key))]
|
|
||||||
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
fn increment(&self, key: &[u8]) -> Result<Vec<u8>> {
|
||||||
let guard = self.engine.write_lock();
|
let guard = self.engine.write_lock();
|
||||||
|
|
||||||
|
@ -337,7 +327,6 @@ impl Tree for SqliteTable {
|
||||||
Ok(new)
|
Ok(new)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn scan_prefix<'a>(&'a self, prefix: Vec<u8>) -> Box<dyn Iterator<Item = TupleOfBytes> + 'a> {
|
fn scan_prefix<'a>(&'a self, prefix: Vec<u8>) -> Box<dyn Iterator<Item = TupleOfBytes> + 'a> {
|
||||||
Box::new(
|
Box::new(
|
||||||
self.iter_from(&prefix, false)
|
self.iter_from(&prefix, false)
|
||||||
|
@ -345,12 +334,10 @@ impl Tree for SqliteTable {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self, prefix))]
|
|
||||||
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
fn watch_prefix<'a>(&'a self, prefix: &[u8]) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> {
|
||||||
self.watchers.watch(prefix)
|
self.watchers.watch(prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self))]
|
|
||||||
fn clear(&self) -> Result<()> {
|
fn clear(&self) -> Result<()> {
|
||||||
debug!("clear: running");
|
debug!("clear: running");
|
||||||
self.engine
|
self.engine
|
||||||
|
|
Loading…
Reference in a new issue