-
Notifications
You must be signed in to change notification settings - Fork 14
do_get: use TTL map to store task state #108
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
Conversation
a8015cc to
ed67281
Compare
| pub(super) runtime: Arc<RuntimeEnv>, | ||
| #[allow(clippy::type_complexity)] | ||
| pub(super) stages: DashMap<StageKey, Arc<OnceCell<(SessionState, Arc<ExecutionStage>)>>>, | ||
| pub(super) stages: TTLMap<StageKey, Arc<OnceCell<TaskData>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oncecell must be in an Arc so we can copy the oncecell after it has been initialized without resetting it
ed67281 to
42b4426
Compare
42b4426 to
40dbce6
Compare
gabotechs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! just some minor comments, +1
The remove() method allows explicit deletion of entries from the TTLMap before they expire naturally.
The do_get call now evicts task state from the map after N calls where N is the number of partitions. This is an approximation because we don't track that unique partition ids are used, so we might evict early in case of retries. The TTLMap will also GC orphaned task state after the configured TTL period.
40dbce6 to
0a5778e
Compare
|
TYFR! |
|
Closes #90 |
ttl_map: add remove() method and tests
The remove() method allows explicit deletion of entries from the TTLMap before they expire naturally.
do_get: use TTL map to store task state
The do_get call now evicts task state from the map after N calls where N
is the number of partitions. This is an approximation because we don't
track that unique partition ids are used, so we might evict early in case
of retries.
The TTLMap will also GC orphaned task state after the configured TTL period.