-
Notifications
You must be signed in to change notification settings - Fork 216
Cleanup phase 3 #685
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
Cleanup phase 3 #685
Conversation
Set minimum Maven version to 3.9.11. Remove obsolete ds-memory reference.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Fixed Javadocs.
This includes a minor bug fix found by ChatGPT.
And remove the awkward constructors used to avoid Finalizer Attacks.
src/test/java/org/apache/datasketches/theta/HeapAlphaSketchTest.java
Dismissed
Show dismissed
Hide dismissed
src/test/java/org/apache/datasketches/theta/UpdateSketchTest.java
Dismissed
Show dismissed
Hide dismissed
src/test/java/org/apache/datasketches/theta/HeapifyWrapSerVer3Test.java
Dismissed
Show dismissed
Hide dismissed
Fixed some very bad assumptions with heapify(...) and wrap(...) where if the simple call was made, i.e., heapify(seg) not only was the default update seed assumed (this is normal), but the seed hash was not checked! Yikes! Same thing with wrap(...). I'm not sure how that ever happened, but it is now fixed. I think a lot of that was associated with the old SerVer 1 and 2 stuff. This also fixed the squirrelly testing that somehow figured that the above was ok!?! Also added some checks when reading the preamble of a user's input segment -- made sure that the segment was at least large enough to hold the full preamble.
|
Lots of cleanup after Sketches class was removed. This also fixed the squirrelly testing that somehow figured that the Also added some checks when reading the preamble of a user's input This is a big PR. I would suggest reviewers go through the changes commit by commit, rather than the whole thing at once. I haven't done the class name changes yet. I will do that in a PR all by itself because it doesn't involve any logic changes, just the names of some classes -- And that should be easier to review by itself. |
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.
Pull Request Overview
Copilot reviewed 79 out of 79 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/main/java/org/apache/datasketches/tuple/QuickSelectSketch.java:1
- Constructor super(...) must be the first statement. Moving super(...) after field assignments will not compile. Restore the prior pattern that validates inside the argument list (e.g., call this(new Validate<>(), seg, deserializer, summaryFactory);) and keep the private constructor that invokes super(...) first, or call super(...) as the first line and refactor validation accordingly.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...java/org/apache/datasketches/tuple/arrayofdoubles/DirectArrayOfDoublesQuickSelectSketch.java
Show resolved
Hide resolved
...java/org/apache/datasketches/tuple/arrayofdoubles/DirectArrayOfDoublesQuickSelectSketch.java
Show resolved
Hide resolved
src/test/java/org/apache/datasketches/theta/UpdateSketchTest.java
Outdated
Show resolved
Hide resolved
I believe that was intentional for compatibility with some legacy system, which is not needed anymore. |
parenthesis to make expressions easier to understand.
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.
Approved - but a clarification need regarding removal serVer 1 and 2 in ThetaSketch.
Apart from this and the fact I need to setup java 25. LGTM
| } | ||
| //not SerVer 3, assume compact stored form | ||
| final short seedHash = Util.computeSeedHash(seed); | ||
| if (serVer == 1) { |
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.
Are we ok we dropping support for server 1 and 2 ?
I mean how to do we know nobody rely on some old serialised sketch here ?
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.
Please see my message on dev@: https://lists.apache.org/thread/4c78gsls7xjrn0b4cosvppywh2clwz6x
To Wit:
Our backward compatibility promise is primarily focused on the binary
compatibility of being able to read serializations of earlier versions of
the code with our latest versions. This is still true. However, up until
recently we have been supporting binary compatibility with very early code
versions at Yahoo that existed long before our code was first open-sourced
in August of 2015 (we became part of ASF in 2020). Since Yahoo is in the
process of obsoleting those systems that used some of that code there is no
reason that we need to keep supporting it.
The older versions being referred to are specifically SerVer 1 and 2 of the Theta Sketch.
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.
@leerho proposed this on the mailing list and received supportive comments.
Versions 1 and 2 predate the open source release, so only Yahoo might have such sketches. And since they can be read and converted to v3 using older library versions, it seems like a reasonable time to clean up this legacy code.
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!
Set pom to min java version of 22.
Set minimum Maven version to 3.9.11.
Remove obsolete ds-memory reference.