Skip to content

Commit

Permalink
fix point query at sst (#168)
Browse files Browse the repository at this point in the history
* fix point query at sst

* code fmt
  • Loading branch information
crwen authored Sep 27, 2024
1 parent 33ffccd commit 2dea4ef
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 19 deletions.
56 changes: 40 additions & 16 deletions benches/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ impl TonboBenchDataBase {
}

impl BenchDatabase for TonboBenchDataBase {
type W<'db> = TonboBenchWriteTransaction<'db> where Self: 'db;
type R<'db> = TonboBenchReadTransaction<'db> where Self: 'db;
type W<'db>
= TonboBenchWriteTransaction<'db>
where
Self: 'db;
type R<'db>
= TonboBenchReadTransaction<'db>
where
Self: 'db;

fn db_type_name() -> &'static str {
"tonbo"
Expand Down Expand Up @@ -228,7 +234,10 @@ pub struct TonboBenchReadTransaction<'a> {
}

impl<'db> BenchReadTransaction for TonboBenchReadTransaction<'db> {
type T<'txn> = TonboBenchReader<'db, 'txn> where Self: 'txn;
type T<'txn>
= TonboBenchReader<'db, 'txn>
where
Self: 'txn;

fn get_reader(&self) -> Self::T<'_> {
TonboBenchReader { txn: &self.txn }
Expand Down Expand Up @@ -280,7 +289,10 @@ pub struct TonboBenchWriteTransaction<'a> {
}

impl<'db> BenchWriteTransaction for TonboBenchWriteTransaction<'db> {
type W<'txn> = TonboBenchInserter<'db, 'txn> where Self: 'txn;
type W<'txn>
= TonboBenchInserter<'db, 'txn>
where
Self: 'txn;

fn get_inserter(&mut self) -> Self::W<'_> {
TonboBenchInserter { txn: &mut self.txn }
Expand Down Expand Up @@ -320,8 +332,14 @@ impl RedbBenchDatabase {
}

impl BenchDatabase for RedbBenchDatabase {
type W<'db> = RedbBenchWriteTransaction where Self: 'db;
type R<'db> = RedbBenchReadTransaction where Self: 'db;
type W<'db>
= RedbBenchWriteTransaction
where
Self: 'db;
type R<'db>
= RedbBenchReadTransaction
where
Self: 'db;

fn db_type_name() -> &'static str {
"redb"
Expand Down Expand Up @@ -351,7 +369,10 @@ pub struct RedbBenchReadTransaction {
}

impl BenchReadTransaction for RedbBenchReadTransaction {
type T<'txn> = RedbBenchReader where Self: 'txn;
type T<'txn>
= RedbBenchReader
where
Self: 'txn;

fn get_reader(&self) -> Self::T<'_> {
let table = self.txn.open_table(X).unwrap();
Expand Down Expand Up @@ -416,7 +437,10 @@ pub struct RedbBenchWriteTransaction {
}

impl BenchWriteTransaction for RedbBenchWriteTransaction {
type W<'txn> = RedbBenchInserter<'txn> where Self: 'txn;
type W<'txn>
= RedbBenchInserter<'txn>
where
Self: 'txn;

fn get_inserter(&mut self) -> Self::W<'_> {
let table = self.txn.open_table(X).unwrap();
Expand Down Expand Up @@ -464,11 +488,11 @@ impl SledBenchDatabase {

impl BenchDatabase for SledBenchDatabase {
type W<'db>
= SledBenchWriteTransaction<'db>
= SledBenchWriteTransaction<'db>
where
Self: 'db;
type R<'db>
= SledBenchReadTransaction<'db>
= SledBenchReadTransaction<'db>
where
Self: 'db;

Expand Down Expand Up @@ -500,7 +524,7 @@ pub struct SledBenchReadTransaction<'db> {

impl BenchReadTransaction for SledBenchReadTransaction<'_> {
type T<'txn>
= SledBenchReader<'txn>
= SledBenchReader<'txn>
where
Self: 'txn;

Expand Down Expand Up @@ -568,7 +592,7 @@ pub struct SledBenchWriteTransaction<'a> {

impl BenchWriteTransaction for SledBenchWriteTransaction<'_> {
type W<'txn>
= SledBenchInserter<'txn>
= SledBenchInserter<'txn>
where
Self: 'txn;

Expand Down Expand Up @@ -624,11 +648,11 @@ impl RocksdbBenchDatabase {

impl BenchDatabase for RocksdbBenchDatabase {
type W<'db>
= RocksdbBenchWriteTransaction<'db>
= RocksdbBenchWriteTransaction<'db>
where
Self: 'db;
type R<'db>
= RocksdbBenchReadTransaction<'db>
= RocksdbBenchReadTransaction<'db>
where
Self: 'db;

Expand Down Expand Up @@ -667,7 +691,7 @@ pub struct RocksdbBenchWriteTransaction<'a> {

impl<'a> BenchWriteTransaction for RocksdbBenchWriteTransaction<'a> {
type W<'txn>
= RocksdbBenchInserter<'txn>
= RocksdbBenchInserter<'txn>
where
Self: 'txn;

Expand Down Expand Up @@ -706,7 +730,7 @@ pub struct RocksdbBenchReadTransaction<'db> {

impl<'db> BenchReadTransaction for RocksdbBenchReadTransaction<'db> {
type T<'txn>
= RocksdbBenchReader<'db, 'txn>
= RocksdbBenchReader<'db, 'txn>
where
Self: 'txn;

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ pub(crate) mod tests {

type Key = String;

type Ref<'r> = TestRef<'r>
type Ref<'r>
= TestRef<'r>
where
Self: 'r;

Expand Down
2 changes: 1 addition & 1 deletion src/ondisk/sstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
projection_mask: ProjectionMask,
) -> parquet::errors::Result<Option<RecordBatchEntry<R>>> {
self.scan(
(Bound::Included(key.value()), Bound::Unbounded),
(Bound::Included(key.value()), Bound::Included(key.value())),
key.ts(),
Some(1),
projection_mask,
Expand Down
3 changes: 2 additions & 1 deletion src/record/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ impl Record for String {

type Key = Self;

type Ref<'r> = &'r str
type Ref<'r>
= &'r str
where
Self: 'r;

Expand Down

0 comments on commit 2dea4ef

Please sign in to comment.