-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Secondary indices work
- Loading branch information
Umur Ozkul
committed
Apr 7, 2023
1 parent
4a351e8
commit 39362f9
Showing
18 changed files
with
261 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"deindexing", | ||
"Llanfairpwll", | ||
"mockall", | ||
"ondo", | ||
"proto", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use crate::db::reference::requests::IndexIteratorRequests; | ||
use crate::db::server::rocks_db_accessor::DbArc; | ||
use crate::db::server::rocks_db_accessor::DbReadLockGuardWrapper; | ||
use crate::db::DbResult; | ||
|
||
pub(crate) enum IndexIteratorRequestsFactoryEnum { | ||
DbArc(DbArc), | ||
Mock, // todo!{}: Replace with the actual mock type when it's available | ||
} | ||
|
||
impl IndexIteratorRequestsFactoryEnum { | ||
pub(crate) fn new_db_arc(db_arc: DbArc) -> Self { | ||
IndexIteratorRequestsFactoryEnum::DbArc(db_arc) | ||
} | ||
|
||
pub(crate) fn new_mock() -> Self { | ||
IndexIteratorRequestsFactoryEnum::Mock | ||
} | ||
pub(crate) fn create_read_locked_requests<'a>( | ||
&'a self, | ||
) -> DbResult<IndexIteratorRequestsEnum<'a>> { | ||
match self { | ||
IndexIteratorRequestsFactoryEnum::DbArc(db_arc) => { | ||
let db_wrapper = DbReadLockGuardWrapper::new(db_arc)?; | ||
Ok(IndexIteratorRequestsEnum::DbWrapper(db_wrapper)) | ||
} | ||
IndexIteratorRequestsFactoryEnum::Mock => { | ||
todo!() | ||
} | ||
} | ||
} | ||
} | ||
|
||
pub(crate) enum IndexIteratorRequestsEnum<'a> { | ||
DbWrapper(DbReadLockGuardWrapper<'a>), | ||
MockWrapper, // todo!: Replace with the actual mock type when it's available | ||
} | ||
|
||
impl<'a> IndexIteratorRequestsEnum<'a> { | ||
pub(crate) fn as_trait(&'a self) -> &'a dyn IndexIteratorRequests<'a> { | ||
match self { | ||
IndexIteratorRequestsEnum::DbWrapper(db_wrapper) => db_wrapper, | ||
IndexIteratorRequestsEnum::MockWrapper => { | ||
todo!() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub(crate) mod index_iterator_requests_factory; | ||
pub(crate) mod table_stored_iterator_requests_factory; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.