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

Further tidying up of submitted PRs #367

Merged
merged 8 commits into from
May 30, 2022

Conversation

petrosagg
Copy link
Contributor

@frankmcsherry thanks for reviewing #360 #361 and #363! I saw you incorporated it them all into #366 but the commits lost provenance/got mixed with other changes of yours.

I opened this PR that has a zero-diff with #366 but with the original commits preserved and the additional changes added by you on top. I looked at the additional changes and all looked good to me! The only question I had was regarding the manual Clone implementations, which I've split out in the last commit of this PR. They look identical to what the automatically derived implementation would do, is it a stylistic preference or am I missing something?

I'll close #360 #361 and #363 in hopes of getting this one merged 🤞

petrosagg and others added 8 commits May 23, 2022 11:25
while `()` is a ZST the potentially dangling reference is still
undefined behaviour. Making it a static is a trivial fix.

Signed-off-by: Petros Angelatos <[email protected]>
The `TraceReader` trait uses associated types to define its `Key`,
`Val`, `Time`, `Diff` but the `BatchReader` trait did not, even though
they are very similar in nature. Usually the choice between asssociated
types or generic parameters on a trait is determined by whether or not a
particular type is expected to implement the same trait multiple times.

My starting point was that these two trait should at the very least be
consistent with respect to their structure and either both use generic
parameters or both use associated types.

All the uses in this repo (and also that I can imagine being useful)
don't really need `BatchReader` to be polymorphic for a particular type
and so I chose to change that one to make it consistent with
`TraceReader`.

The result is quite pleasing as in many cases a lot of generic
parameters are erased.

In order to keep this PR short I left the `Cursor` trait untouched, but
I believe a similar transformation would be beneficial there too,
simplifying further many type signatures.

Signed-off-by: Petros Angelatos <[email protected]>
while `()` is a ZST the potentially dangling reference is still
undefined behaviour. Making it a static is a trivial fix.

Signed-off-by: Petros Angelatos <[email protected]>
@frankmcsherry
Copy link
Member

If things look confusing, it is because I started from just your PR descriptions rather than the PRs themselves. I knew I wanted to hit a few more things than you did (e.g. simplifying generic arguments to just the Batch argument, and doing the same thing for Cursor), so I retyped all of it. I'm happy to reframe this as edits on your work though, now that this experiment has been conducted (and I understand more clearly why various changes are made / not made).

The manual Clone implementations are .. I think just a consequence of me not doing that optimization once I removed the generic arguments (and .. perhaps there are others now too?). Any other weird edits aren't opinions on my part so much as diffs between what you and I did (I did minimal reformatting, so probably those edits are just returning toward the original state; could take or leave them!).

@petrosagg
Copy link
Contributor Author

Great, I dropped the last commit that added the manual Clone impls in favor of the automatic ones. I had searched for these before and only found these ones TimelyDataflow/timely-dataflow#430

@frankmcsherry frankmcsherry merged commit 8123b20 into TimelyDataflow:master May 30, 2022
@frankmcsherry
Copy link
Member

Thanks much, and apologies for the confusion!

This was referenced Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants