@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "conduwuit_database"
|
||||
name = "tuwunel_database"
|
||||
categories.workspace = true
|
||||
description.workspace = true
|
||||
edition.workspace = true
|
||||
@@ -21,33 +21,32 @@ io_uring = [
|
||||
"rust-rocksdb/io-uring",
|
||||
]
|
||||
jemalloc = [
|
||||
"conduwuit-core/jemalloc",
|
||||
"tuwunel-core/jemalloc",
|
||||
"rust-rocksdb/jemalloc",
|
||||
]
|
||||
jemalloc_conf = [
|
||||
"conduwuit-core/jemalloc_conf",
|
||||
"tuwunel-core/jemalloc_conf",
|
||||
]
|
||||
jemalloc_prof = [
|
||||
"conduwuit-core/jemalloc_prof",
|
||||
"tuwunel-core/jemalloc_prof",
|
||||
]
|
||||
jemalloc_stats = [
|
||||
"conduwuit-core/jemalloc_stats",
|
||||
"tuwunel-core/jemalloc_stats",
|
||||
]
|
||||
release_max_log_level = [
|
||||
"conduwuit-core/release_max_log_level",
|
||||
"tuwunel-core/release_max_log_level",
|
||||
"log/max_level_trace",
|
||||
"log/release_max_level_info",
|
||||
"tracing/max_level_trace",
|
||||
"tracing/release_max_level_info",
|
||||
]
|
||||
zstd_compression = [
|
||||
"conduwuit-core/zstd_compression",
|
||||
"tuwunel-core/zstd_compression",
|
||||
"rust-rocksdb/zstd",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
async-channel.workspace = true
|
||||
conduwuit-core.workspace = true
|
||||
const-str.workspace = true
|
||||
futures.workspace = true
|
||||
log.workspace = true
|
||||
@@ -58,6 +57,7 @@ serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tuwunel-core.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#[cfg(conduwuit_bench)]
|
||||
#[cfg(tuwunel_bench)]
|
||||
extern crate test;
|
||||
|
||||
#[cfg(conduwuit_bench)]
|
||||
#[cfg_attr(conduwuit_bench, bench)]
|
||||
#[cfg(tuwunel_bench)]
|
||||
#[cfg_attr(tuwunel_bench, bench)]
|
||||
fn ser_str(b: &mut test::Bencher) {
|
||||
use conduwuit::ruma::{RoomId, UserId};
|
||||
use tuwunel::ruma::{RoomId, UserId};
|
||||
|
||||
use crate::ser::serialize_to_vec;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use conduwuit::{
|
||||
Error, Result, arrayvec::ArrayVec, checked, debug::DebugInspect, err, utils::string,
|
||||
};
|
||||
use serde::{
|
||||
Deserialize, de,
|
||||
de::{DeserializeSeed, Visitor},
|
||||
};
|
||||
use tuwunel_core::{
|
||||
Error, Result, arrayvec::ArrayVec, checked, debug::DebugInspect, err, utils::string,
|
||||
};
|
||||
|
||||
use crate::util::unhandled;
|
||||
|
||||
@@ -416,7 +416,7 @@ impl<'a, 'de: 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
||||
)]
|
||||
fn deserialize_any<V: Visitor<'de>>(self, visitor: V) -> Result<V::Value> {
|
||||
debug_assert_eq!(
|
||||
conduwuit::debug::type_name::<V>(),
|
||||
tuwunel_core::debug::type_name::<V>(),
|
||||
"serde_json::value::de::<impl serde::de::Deserialize for \
|
||||
serde_json::value::Value>::deserialize::ValueVisitor",
|
||||
"deserialize_any: type not expected"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::convert::identity;
|
||||
|
||||
use conduwuit::Result;
|
||||
use serde::Deserialize;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
pub trait Deserialized {
|
||||
fn map_de<T, U, F>(self, f: F) -> Result<U>
|
||||
|
||||
@@ -17,11 +17,11 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
use conduwuit::{Err, Result, debug, info, warn};
|
||||
use rocksdb::{
|
||||
AsColumnFamilyRef, BoundColumnFamily, DBCommon, DBWithThreadMode, MultiThreaded,
|
||||
WaitForCompactOptions,
|
||||
};
|
||||
use tuwunel_core::{Err, Result, debug, info, warn};
|
||||
|
||||
use crate::{
|
||||
Context,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use std::{ffi::OsString, path::PathBuf};
|
||||
|
||||
use conduwuit::{Err, Result, error, implement, info, utils::time::rfc2822_from_seconds, warn};
|
||||
use rocksdb::backup::{BackupEngine, BackupEngineOptions};
|
||||
use tuwunel_core::{
|
||||
Err, Result, error, implement, info, utils::time::rfc2822_from_seconds, warn,
|
||||
};
|
||||
|
||||
use super::Engine;
|
||||
use crate::util::map_err;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use conduwuit::{Config, Result, err, utils::math::Expected};
|
||||
use rocksdb::{
|
||||
BlockBasedIndexType, BlockBasedOptions, BlockBasedPinningTier, Cache,
|
||||
DBCompressionType as CompressionType, DataBlockIndexType, FifoCompactOptions,
|
||||
LruCacheOptions, Options, UniversalCompactOptions, UniversalCompactionStopStyle,
|
||||
};
|
||||
use tuwunel_core::{Config, Result, err, utils::math::Expected};
|
||||
|
||||
use super::descriptor::{CacheDisp, Descriptor};
|
||||
use crate::{Context, util::map_err};
|
||||
|
||||
@@ -3,8 +3,8 @@ use std::{
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use conduwuit::{Result, Server, debug, utils::math::usize_from_f64};
|
||||
use rocksdb::{Cache, Env, LruCacheOptions};
|
||||
use tuwunel_core::{Result, Server, debug, utils::math::usize_from_f64};
|
||||
|
||||
use crate::{or_else, pool::Pool};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{cmp, convert::TryFrom};
|
||||
|
||||
use conduwuit::{Config, Result, utils};
|
||||
use rocksdb::{Cache, DBRecoveryMode, Env, LogLevel, Options, statistics::StatsLevel};
|
||||
use tuwunel_core::{Config, Result, utils};
|
||||
|
||||
use super::{cf_opts::cache_size_f64, logger::handle as handle_log};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use conduwuit::utils::string::EMPTY;
|
||||
use rocksdb::{
|
||||
DBCompactionPri as CompactionPri, DBCompactionStyle as CompactionStyle,
|
||||
DBCompressionType as CompressionType,
|
||||
};
|
||||
use tuwunel_core::utils::string::EMPTY;
|
||||
|
||||
use super::cf_opts::SENTINEL_COMPRESSION_LEVEL;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{Result, implement};
|
||||
use rocksdb::LiveFile as SstFile;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::Engine;
|
||||
use crate::util::map_err;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{debug, error, warn};
|
||||
use rocksdb::LogLevel;
|
||||
use tuwunel_core::{debug, error, warn};
|
||||
|
||||
#[tracing::instrument(
|
||||
parent = None,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::fmt::Write;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use rocksdb::perf::get_memory_usage_stats;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::Engine;
|
||||
use crate::or_else;
|
||||
|
||||
@@ -4,8 +4,8 @@ use std::{
|
||||
sync::{Arc, atomic::AtomicU32},
|
||||
};
|
||||
|
||||
use conduwuit::{Result, debug, implement, info, warn};
|
||||
use rocksdb::{ColumnFamilyDescriptor, Options};
|
||||
use tuwunel_core::{Result, debug, implement, info, warn};
|
||||
|
||||
use super::{
|
||||
Db, Engine,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use conduwuit::{Err, Result, info, warn};
|
||||
use rocksdb::Options;
|
||||
use tuwunel_core::{Err, Result, info, warn};
|
||||
|
||||
use super::Db;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{fmt, fmt::Debug, ops::Deref};
|
||||
|
||||
use conduwuit::Result;
|
||||
use rocksdb::DBPinnableSlice;
|
||||
use serde::{Deserialize, Serialize, Serializer};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::{Deserialized, Slice, keyval::deserialize_val};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{Result, smallvec::SmallVec};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, smallvec::SmallVec};
|
||||
|
||||
use crate::{de, ser};
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use conduwuit::Result;
|
||||
use rocksdb::{AsColumnFamilyRef, ColumnFamily, ReadOptions, WriteOptions};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
pub(crate) use self::options::{
|
||||
cache_iter_options_default, cache_read_options_default, iter_options_default,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, TryStreamExt};
|
||||
use tuwunel_core::{
|
||||
Result, implement,
|
||||
utils::stream::{ReadyExt, TryIgnore},
|
||||
};
|
||||
use futures::{Stream, TryStreamExt};
|
||||
|
||||
use crate::keyval::Key;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{Err, Result, implement};
|
||||
use rocksdb::{BottommostLevelCompaction, CompactOptions};
|
||||
use tuwunel_core::{Err, Result, implement};
|
||||
|
||||
use crate::keyval::KeyBuf;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use std::{convert::AsRef, fmt::Debug, future::Future, io::Write, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::FutureExt;
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{
|
||||
Result,
|
||||
arrayvec::ArrayVec,
|
||||
err, implement,
|
||||
utils::{future::TryExtExt, result::FlatOk},
|
||||
};
|
||||
use futures::FutureExt;
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{keyval::KeyBuf, ser};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{fmt::Debug, future::Future, sync::Arc};
|
||||
|
||||
use conduwuit::implement;
|
||||
use futures::stream::StreamExt;
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::implement;
|
||||
|
||||
/// Count the total number of entries in the map.
|
||||
#[implement(super::Map)]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Err, Result, err, implement, utils::result::MapExpect};
|
||||
use futures::{Future, FutureExt, TryFutureExt, future::ready};
|
||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Err, Result, err, implement, utils::result::MapExpect};
|
||||
|
||||
use crate::{
|
||||
Handle,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::{convert::AsRef, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||
use tuwunel_core::{
|
||||
Result, implement,
|
||||
utils::{
|
||||
IterStream,
|
||||
stream::{WidebandExt, automatic_amplification, automatic_width},
|
||||
},
|
||||
};
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||
|
||||
use super::get::{cached_handle_from, handle_from};
|
||||
use crate::Handle;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
use std::{convert::AsRef, fmt::Debug, io::Write};
|
||||
|
||||
use conduwuit::{arrayvec::ArrayVec, implement};
|
||||
use rocksdb::WriteBatchWithTransaction;
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{arrayvec::ArrayVec, implement};
|
||||
|
||||
use crate::{
|
||||
keyval::{KeyBuf, ValBuf},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::stream::is_cached;
|
||||
use crate::{keyval, keyval::Key, stream};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::stream_from::is_cached;
|
||||
use crate::{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::keyval::{Key, result_deserialize_key, serialize_key};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{convert::AsRef, fmt::Debug, io::Write, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, arrayvec::ArrayVec, implement};
|
||||
use futures::Future;
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{Result, arrayvec::ArrayVec, implement};
|
||||
|
||||
use crate::{Handle, keyval::KeyBuf, ser};
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::{fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{
|
||||
Result, implement,
|
||||
utils::{
|
||||
IterStream,
|
||||
stream::{WidebandExt, automatic_amplification, automatic_width},
|
||||
},
|
||||
};
|
||||
use futures::{Stream, StreamExt, TryStreamExt};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{Handle, keyval::KeyBuf, ser};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{convert::AsRef, fmt::Debug, io::Write};
|
||||
|
||||
use conduwuit::{arrayvec::ArrayVec, implement};
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{arrayvec::ArrayVec, implement};
|
||||
|
||||
use crate::{keyval::KeyBuf, ser, util::or_else};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::rev_stream::is_cached;
|
||||
use crate::{keyval, keyval::Key, stream};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use super::rev_stream_from::is_cached;
|
||||
use crate::{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::keyval::{Key, result_deserialize_key, serialize_key};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::{keyval, keyval::KeyVal, stream};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::{
|
||||
keyval::{KeyVal, result_deserialize, serialize_key},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::keyval::{KeyVal, result_deserialize, serialize_key};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::Deserialize;
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::{keyval, keyval::KeyVal, stream};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
|
||||
use rocksdb::Direction;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::task;
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::{
|
||||
keyval::{KeyVal, result_deserialize, serialize_key},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::{convert::AsRef, fmt::Debug, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, implement};
|
||||
use futures::{Stream, StreamExt, TryStreamExt, future};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tuwunel_core::{Result, implement};
|
||||
|
||||
use crate::keyval::{KeyVal, result_deserialize, serialize_key};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use conduwuit::Result;
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use crate::{
|
||||
Engine, Map,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#![type_length_limit = "3072"]
|
||||
|
||||
extern crate conduwuit_core as conduwuit;
|
||||
extern crate rust_rocksdb as rocksdb;
|
||||
|
||||
conduwuit::mod_ctor! {}
|
||||
conduwuit::mod_dtor! {}
|
||||
conduwuit::rustc_flags_capture! {}
|
||||
tuwunel_core::mod_ctor! {}
|
||||
tuwunel_core::mod_dtor! {}
|
||||
tuwunel_core::rustc_flags_capture! {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod benches;
|
||||
@@ -27,7 +26,7 @@ mod watchers;
|
||||
|
||||
use std::{ops::Index, sync::Arc};
|
||||
|
||||
use conduwuit::{Result, Server, err};
|
||||
use tuwunel_core::{Result, Server, err};
|
||||
|
||||
pub use self::{
|
||||
de::{Ignore, IgnoreAll},
|
||||
|
||||
@@ -11,16 +11,16 @@ use std::{
|
||||
};
|
||||
|
||||
use async_channel::{QueueStrategy, Receiver, RecvError, Sender};
|
||||
use conduwuit::{
|
||||
use futures::{TryFutureExt, channel::oneshot};
|
||||
use oneshot::Sender as ResultSender;
|
||||
use rocksdb::Direction;
|
||||
use tuwunel_core::{
|
||||
Error, Result, Server, debug, err, error, implement,
|
||||
result::DebugInspect,
|
||||
smallvec::SmallVec,
|
||||
trace,
|
||||
utils::sys::compute::{get_affinity, nth_core_available, set_affinity},
|
||||
};
|
||||
use futures::{TryFutureExt, channel::oneshot};
|
||||
use oneshot::Sender as ResultSender;
|
||||
use rocksdb::Direction;
|
||||
|
||||
use self::configure::configure;
|
||||
use crate::{Handle, Map, keyval::KeyBuf, stream};
|
||||
@@ -70,7 +70,7 @@ const QUEUE_LIMIT: (usize, usize) = (1, 4096);
|
||||
const BATCH_INLINE: usize = 1;
|
||||
|
||||
const WORKER_STACK_SIZE: usize = 1_048_576;
|
||||
const WORKER_NAME: &str = "conduwuit:db";
|
||||
const WORKER_NAME: &str = "tuwunel:db";
|
||||
|
||||
#[implement(Pool)]
|
||||
pub(crate) fn new(server: &Arc<Server>) -> Result<Arc<Self>> {
|
||||
@@ -281,8 +281,8 @@ fn worker_init(&self, id: usize) {
|
||||
set_affinity(affinity.clone());
|
||||
|
||||
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||
if affinity.clone().count() == 1 && conduwuit::alloc::je::is_affine_arena() {
|
||||
use conduwuit::{
|
||||
if affinity.clone().count() == 1 && tuwunel_core::alloc::je::is_affine_arena() {
|
||||
use tuwunel_core::{
|
||||
alloc::je::this_thread::{arena_id, set_arena},
|
||||
result::LogDebugErr,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use conduwuit::{
|
||||
use tuwunel_core::{
|
||||
Server, debug, debug_info, expected, is_equal_to,
|
||||
utils::{
|
||||
math::usize_from_f64,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::io::Write;
|
||||
|
||||
use conduwuit::{Error, Result, debug::type_name, err, result::DebugInspect, utils::exchange};
|
||||
use serde::{Deserialize, Serialize, ser};
|
||||
use tuwunel_core::{Error, Result, debug::type_name, err, result::DebugInspect, utils::exchange};
|
||||
|
||||
use crate::util::unhandled;
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ mod keys_rev;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{Result, utils::exchange};
|
||||
use rocksdb::{DBRawIteratorWithThreadMode, ReadOptions};
|
||||
use tuwunel_core::{Result, utils::exchange};
|
||||
|
||||
pub(crate) use self::{items::Items, items_rev::ItemsRev, keys::Keys, keys_rev::KeysRev};
|
||||
use crate::{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::pin::Pin;
|
||||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use super::{Cursor, State, keyval_longevity};
|
||||
use crate::keyval::KeyVal;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::pin::Pin;
|
||||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use super::{Cursor, State, keyval_longevity};
|
||||
use crate::keyval::KeyVal;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::pin::Pin;
|
||||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use super::{Cursor, State, slice_longevity};
|
||||
use crate::keyval::Key;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::pin::Pin;
|
||||
|
||||
use conduwuit::Result;
|
||||
use futures::{
|
||||
Stream,
|
||||
stream::FusedStream,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
use super::{Cursor, State, slice_longevity};
|
||||
use crate::keyval::Key;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use conduwuit::{
|
||||
use serde::Serialize;
|
||||
use tuwunel_core::{
|
||||
arrayvec::ArrayVec,
|
||||
ruma::{EventId, RoomId, UserId, serde::Raw},
|
||||
};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::{
|
||||
Ignore, Interfix, de, ser,
|
||||
@@ -76,7 +76,7 @@ fn ser_overflow() {
|
||||
|
||||
#[test]
|
||||
fn ser_complex() {
|
||||
use conduwuit::ruma::Mxc;
|
||||
use tuwunel_core::ruma::Mxc;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct Dim {
|
||||
@@ -110,7 +110,7 @@ fn ser_complex() {
|
||||
|
||||
#[test]
|
||||
fn ser_json() {
|
||||
use conduwuit::ruma::api::client::filter::FilterDefinition;
|
||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||
|
||||
let filter = FilterDefinition {
|
||||
event_fields: Some(vec!["content.body".to_owned()]),
|
||||
@@ -125,7 +125,7 @@ fn ser_json() {
|
||||
|
||||
#[test]
|
||||
fn ser_json_value() {
|
||||
use conduwuit::ruma::api::client::filter::FilterDefinition;
|
||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||
|
||||
let filter = FilterDefinition {
|
||||
event_fields: Some(vec!["content.body".to_owned()]),
|
||||
@@ -164,7 +164,7 @@ fn ser_json_macro() {
|
||||
#[test]
|
||||
#[cfg_attr(debug_assertions, should_panic(expected = "serializing string at the top-level"))]
|
||||
fn ser_json_raw() {
|
||||
use conduwuit::ruma::api::client::filter::FilterDefinition;
|
||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||
|
||||
let filter = FilterDefinition {
|
||||
event_fields: Some(vec!["content.body".to_owned()]),
|
||||
@@ -181,7 +181,7 @@ fn ser_json_raw() {
|
||||
#[test]
|
||||
#[cfg_attr(debug_assertions, should_panic(expected = "you can skip serialization instead"))]
|
||||
fn ser_json_raw_json() {
|
||||
use conduwuit::ruma::api::client::filter::FilterDefinition;
|
||||
use tuwunel_core::ruma::api::client::filter::FilterDefinition;
|
||||
|
||||
let filter = FilterDefinition {
|
||||
event_fields: Some(vec!["content.body".to_owned()]),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::Result;
|
||||
use rocksdb::{Direction, ErrorKind, IteratorMode};
|
||||
use tuwunel_core::Result;
|
||||
|
||||
//#[cfg(debug_assertions)]
|
||||
macro_rules! unhandled {
|
||||
@@ -38,19 +38,19 @@ pub(crate) fn _into_direction(mode: &IteratorMode<'_>) -> Direction {
|
||||
#[inline]
|
||||
pub(crate) fn result<T>(
|
||||
r: std::result::Result<T, rocksdb::Error>,
|
||||
) -> Result<T, conduwuit::Error> {
|
||||
) -> Result<T, tuwunel_core::Error> {
|
||||
r.map_or_else(or_else, and_then)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn and_then<T>(t: T) -> Result<T, conduwuit::Error> { Ok(t) }
|
||||
pub(crate) fn and_then<T>(t: T) -> Result<T, tuwunel_core::Error> { Ok(t) }
|
||||
|
||||
pub(crate) fn or_else<T>(e: rocksdb::Error) -> Result<T, conduwuit::Error> { Err(map_err(e)) }
|
||||
pub(crate) fn or_else<T>(e: rocksdb::Error) -> Result<T, tuwunel_core::Error> { Err(map_err(e)) }
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn is_incomplete(e: &rocksdb::Error) -> bool { e.kind() == ErrorKind::Incomplete }
|
||||
|
||||
pub(crate) fn map_err(e: rocksdb::Error) -> conduwuit::Error {
|
||||
pub(crate) fn map_err(e: rocksdb::Error) -> tuwunel_core::Error {
|
||||
let kind = io_error_kind(&e.kind());
|
||||
let string = e.into_string();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user