Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Dec 28, 2024
1 parent 570d99c commit 1a5224b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@ use among::Among;
use dbutils::{
buffer::VacantBuffer,
checksum::{BuildChecksumer, Crc32},
equivalentor::Ascend,
state::{Active, MaybeTombstone},
};
use either::Either;
use rarena_allocator::Allocator;

#[cfg(any(feature = "bounded", feature = "unbounded"))]
use crate::memtable;
use crate::{
batch::Batch,
error::Error,
log::Log,
memtable::{self, Memtable, MutableMemtable},
memtable::{Memtable, MutableMemtable},
swmr,
types::{BufWriter, KeyBuilder, Remove, Update, ValueBuilder},
HEADER_SIZE,
};

pub use crate::memtable::dynamic::DynamicMemtable;
pub use dbutils::equivalentor::{Ascend, Descend};

#[cfg(feature = "bounded")]
use crate::memtable::dynamic::bounded;

#[cfg(feature = "unbounded")]
use crate::memtable::dynamic::unbounded;

pub use crate::memtable::dynamic::DynamicMemtable;

/// A multiple versions ordered write-ahead log implementation for concurrent thread environments.
pub type OrderWal<M, S = Crc32> = swmr::OrderWal<M, S>;

Expand Down
4 changes: 3 additions & 1 deletion src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ use dbutils::{
use either::Either;
use rarena_allocator::Allocator;

#[cfg(any(feature = "bounded", feature = "unbounded"))]
use crate::memtable;
use crate::{
batch::Batch,
error::Error,
log::Log,
memtable::{self, Memtable, MutableMemtable},
memtable::{Memtable, MutableMemtable},
swmr,
types::{BufWriter, KeyBuilder, Remove, Update, ValueBuilder},
HEADER_SIZE,
Expand Down
15 changes: 11 additions & 4 deletions src/memtable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use core::ops::{Bound, RangeBounds};
use core::ops::Bound;
#[cfg(any(feature = "bounded", feature = "unbounded"))]
use core::ops::RangeBounds;

use crate::types::{Query, RecordPointer, WithValue};
use crate::types::{RecordPointer, WithValue};

#[cfg(any(feature = "bounded", feature = "unbounded"))]
use crate::types::Query;

#[cfg(feature = "skl")]
pub(crate) mod bounded;
Expand Down Expand Up @@ -116,6 +121,7 @@ pub trait RangeEntry<'a, O> {
fn version(&self) -> u64;
}

#[cfg(any(feature = "bounded", feature = "unbounded"))]
trait RangeEntryExt<'a, O>: RangeEntry<'a, O> {
/// Returns the start bound of the range entry.
fn query_start_bound(&self) -> Bound<Query<Self::Key>> {
Expand All @@ -141,6 +147,7 @@ trait RangeEntryExt<'a, O>: RangeEntry<'a, O> {
}
}

#[cfg(any(feature = "bounded", feature = "unbounded"))]
impl<'a, O, T> RangeEntryExt<'a, O> for T where T: RangeEntry<'a, O> {}

/// A memory table which is used to store pointers to the underlying entries.
Expand Down Expand Up @@ -276,7 +283,7 @@ mod sealed {

#[cfg(not(any(feature = "skl", feature = "crossbeam-skiplist-mvcc")))]
pub trait Sealed<'a, I>: dbutils::state::State {
type Output;
type Value;

fn input(data: &Self::Data<'a, I>) -> Self::Data<'a, &'a [u8]>;

Expand All @@ -288,7 +295,7 @@ mod sealed {
where
Self: Sized;

fn transfer(data: &Self::Data<'a, I>) -> Self::Data<'a, Self::Output>;
fn transfer(data: &Self::Data<'a, I>) -> Self::Data<'a, Self::Value>;

fn leak<T>(data: Self::Data<'a, T>) -> Option<T>;

Expand Down
2 changes: 2 additions & 0 deletions src/types/mode.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

/// The type mode of the memtable, either dynamic key-value or generic structured key-value.
pub trait Mode: sealed::Sealed {}

Expand Down
2 changes: 2 additions & 0 deletions src/types/raw.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

use core::{ops::Bound, slice};

use dbutils::leb128::decode_u64_varint;
Expand Down

0 comments on commit 1a5224b

Please sign in to comment.