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

ArconState/Index/Backend Rework #303

Open
Max-Meldrum opened this issue Jan 27, 2022 · 0 comments
Open

ArconState/Index/Backend Rework #303

Max-Meldrum opened this issue Jan 27, 2022 · 0 comments
Assignees
Labels
domain: state Anything related to Arcon State enhancement New feature or request

Comments

@Max-Meldrum
Copy link
Member

The existing design is not the best as it currently exposes functions that the user should not have access to.

ArconState

set_key / set_timestamp are exposed to users. This is something that only the internal runtime should be able to modify/call.

Backend

For the state constructor, users should not have access to Backend itself, but some form of wrapper around it with limited exposed functions.

struct WriteContext {
   key: u64,
   timestamp: u64
}
pub struct BackendContainer<B: Backend> {
   crate context:  WriteContext,
   crate inner: Arc<B>
}

OperatorBuilder {
  operator: Arc::new(|| ...),
  state: Arc::new(|c: BackendContainer| ...), // Here instead of Backend
  conf: Default::default(),
}

Index

Right now indexes do not have an explicit constructor function and all of them expect Arc<Backend> input.
The following might be a good option instead.

pub trait IndexOps {
    fn create(id: &str, container: BackendContainer) -> Self;
    ....
}
@Max-Meldrum Max-Meldrum added enhancement New feature or request domain: state Anything related to Arcon State labels Jan 27, 2022
@Max-Meldrum Max-Meldrum self-assigned this Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: state Anything related to Arcon State enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant