-
Notifications
You must be signed in to change notification settings - Fork 18
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
Bug/#427 make iterate by contribute more streamable, replace filter with takewhile #428
Bug/#427 make iterate by contribute more streamable, replace filter with takewhile #428
Conversation
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.
👍 thank you for this well needed improvement. it would be nice to eventually do the same for the snapshot view part of the cell iterator as well. 😄
a few inline questions and comments are below
oshdb-api/src/main/java/org/heigit/ohsome/oshdb/api/mapreducer/backend/Kernels.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Outdated
Show resolved
Hide resolved
oshdb-util/src/main/java/org/heigit/ohsome/oshdb/util/celliterator/CellIterator.java
Show resolved
Hide resolved
0ee81eb
to
8c7af5f
Compare
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.
would you like to add a line to the changelog for this? I think this is a nice improvement, which does deserve to be mentioned. 👍
Done. I also create a new Issue #429 for the snapshot view part as well. |
breaking for-loop up into iterator opening up iterateBy to accept Iterables instead of GridOSHEntity
5f00924
to
17c0155
Compare
breaking for-loop up into iterator opening up iterateBy to accept Iterables instead of GridOSHEntity replace filter with takeWhile
This is the PR for Issue #427
Task keep processing for a while despite it is canceled.
Description
Replacing/refactoring the for-loop in CellIterator
iterateByContribution
, to an Iterator which could be stream.The previous approach with a for-loop keeps generating all Contributions for an OSHEntity, collecting those into an LinkedList and finally streams the list "out" of the method
iterateByContribution
.The new version skips the collecting of all Contributions to a LinkedList completely, that has the advantage,
Corresponding issue
Closes #427
Checklist
I have made corresponding changes to the documentationI have adjusted the examples or created an issue in the corresponding repositoryI have adjusted the benchmark or created an issue in the corresponding repository