Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference backend implementation using BTreeMap #431

Open
akiradeveloper opened this issue Oct 20, 2024 · 2 comments
Open

Reference backend implementation using BTreeMap #431

akiradeveloper opened this issue Oct 20, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@akiradeveloper
Copy link
Owner

For reference, it is nice to have a backend implementation using BTreeMap.

impl Node {
    pub fn new(id: u8, port: u16, n_shards: u32) -> Result<Self> {
        let nd_tag = format!("ND{port}>");
        let (tx, rx) = tokio::sync::oneshot::channel();

        let svc_task = async move {
            info!("add (id={id})");

            let node_id = {
                let address = format!("http://127.0.0.1:{port}");
                address.parse().unwrap()
            };
            let node = sorock::RaftNode::new(node_id);

            let db = {
                // REPLACE HERE
                // let mem = redb::backends::InMemoryBackend::new();
                // let db = redb::Database::builder().create_with_backend(mem).unwrap();
                // sorock::backend::redb::Backend::new(db)

                sorock::backend::btree::Backend::new()
            };
@akiradeveloper akiradeveloper added the good first issue Good for newcomers label Oct 20, 2024
@Imesh7
Copy link

Imesh7 commented Oct 29, 2024

Hi @akiradeveloper ,
I would like to work on this issue.

Thanks

@Imesh7
Copy link

Imesh7 commented Dec 17, 2024

@akiradeveloper I would like to know , if there is any suggestion.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants