-
Notifications
You must be signed in to change notification settings - Fork 184
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
Generalize flat container implementations to less specific regions #518
Draft
antiguru
wants to merge
7
commits into
TimelyDataflow:master
Choose a base branch
from
antiguru:region_update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3edbebe
Define ConsolidateLayout for FlatStack in terms of MergerChunk
antiguru 4601ef4
Same thing for BuilderInput
antiguru a47f020
Generalize MergerChunk
antiguru 7d3ddaa
Renaming
antiguru 0697f7a
FlatStack generic storage
antiguru 8d476ef
Expand comments
antiguru bb5836a
CapacityContainer
antiguru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -401,12 +401,12 @@ where | |
|
||
mod flatcontainer { | ||
use timely::container::flatcontainer::{FlatStack, IntoOwned, Push, Region}; | ||
use timely::container::flatcontainer::impls::tuple::{TupleABCRegion, TupleABRegion}; | ||
use timely::progress::Timestamp; | ||
|
||
use crate::difference::Semigroup; | ||
use crate::lattice::Lattice; | ||
use crate::trace::implementations::{BatchContainer, BuilderInput, FlatLayout, Layout, OffsetList, Update}; | ||
use crate::trace::implementations::merge_batcher_flat::RegionUpdate; | ||
|
||
impl<K, V, T, R> Update for FlatLayout<K, V, T, R> | ||
where | ||
|
@@ -448,36 +448,30 @@ mod flatcontainer { | |
type OffsetContainer = OffsetList; | ||
} | ||
|
||
impl<K,KBC,V,VBC,T,R> BuilderInput<KBC, VBC> for FlatStack<TupleABCRegion<TupleABRegion<K,V>,T,R>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is important. |
||
impl<KBC,VBC, R> BuilderInput<KBC, VBC> for FlatStack<R> | ||
where | ||
K: Region + Clone + 'static, | ||
V: Region + Clone + 'static, | ||
T: Region + Clone + 'static, | ||
R: Region + Clone + 'static, | ||
for<'a> K::ReadItem<'a>: Copy + Ord, | ||
for<'a> V::ReadItem<'a>: Copy + Ord, | ||
for<'a> T::ReadItem<'a>: Copy + Ord, | ||
for<'a> R::ReadItem<'a>: Copy + Ord, | ||
R: RegionUpdate + Region + Clone + 'static, | ||
KBC: BatchContainer, | ||
VBC: BatchContainer, | ||
for<'a> KBC::ReadItem<'a>: PartialEq<K::ReadItem<'a>>, | ||
for<'a> VBC::ReadItem<'a>: PartialEq<V::ReadItem<'a>>, | ||
for<'a> KBC::ReadItem<'a>: PartialEq<R::Key<'a>>, | ||
for<'a> VBC::ReadItem<'a>: PartialEq<R::Val<'a>>, | ||
{ | ||
type Key<'a> = K::ReadItem<'a>; | ||
type Val<'a> = V::ReadItem<'a>; | ||
type Time = T::Owned; | ||
type Diff = R::Owned; | ||
type Key<'a> = R::Key<'a>; | ||
type Val<'a> = R::Val<'a>; | ||
type Time = R::TimeOwned; | ||
type Diff = R::DiffOwned; | ||
|
||
fn into_parts<'a>(((key, val), time, diff): Self::Item<'a>) -> (Self::Key<'a>, Self::Val<'a>, Self::Time, Self::Diff) { | ||
fn into_parts<'a>(item: Self::Item<'a>) -> (Self::Key<'a>, Self::Val<'a>, Self::Time, Self::Diff) { | ||
let (key, val, time, diff) = R::into_parts(item); | ||
(key, val, time.into_owned(), diff.into_owned()) | ||
} | ||
|
||
fn key_eq(this: &Self::Key<'_>, other: KBC::ReadItem<'_>) -> bool { | ||
KBC::reborrow(other) == K::reborrow(*this) | ||
KBC::reborrow(other) == R::reborrow_key(*this) | ||
} | ||
|
||
fn val_eq(this: &Self::Val<'_>, other: VBC::ReadItem<'_>) -> bool { | ||
VBC::reborrow(other) == V::reborrow(*this) | ||
VBC::reborrow(other) == R::reborrow_val(*this) | ||
} | ||
} | ||
} | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This change is important.