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
HBASE-16002 Made constructors of DataType subclasses public #157
Conversation
🎊 +1 overall
This message was automatically generated. |
@@ -32,7 +32,7 @@ | |||
public static final OrderedBlob ASCENDING = new OrderedBlob(Order.ASCENDING); | |||
public static final OrderedBlob DESCENDING = new OrderedBlob(Order.DESCENDING); | |||
|
|||
protected OrderedBlob(Order order) { | |||
public OrderedBlob(Order order) { |
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.
I think this is intentional? User can use the above ASCENDING and DESCENDING directly?
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.
I would guess so. @ndimiduk probably can answer this question better.
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.
So that's precisely it. See my last comment on JIRA. The original design of this part of the API was to try to prevent callers from needless allocations. That couldn't be done uniformly, though, as some of these implementations require explicit construction parameters. I myself filed a ticket wondering why I had left some constructors private. I believe the uniformity of public constructors across all concrete types is more consistent that having static constants in most, but not all, places.
This is definitely a subjective area of the API design and I'd love to get other opinions :)
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.
To make it consistent, how about making the constructors public for consistency reasons and deprecate the static constants (and remove them in another release) to make it more consistent?
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.
If you think deprecating the static constants is appropriate, then I have no objection. There's always a balance between minimizing our supported surface area and downstream convenience. I've not followed things very closely as of late, but it seems we're on a pretty strong kick to deprecate/drop old interfaces.
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.
I think that we should discuss this on the dev list. @Apache9 Is your question answered? What do you think? Should we leave it as is or should we deprecate the static constants?
🎊 +1 overall
This message was automatically generated. |
IMO make all constructors public (and deprecate the static defines). Its consistent. If a problem w/ too many new objects, can review then. |
🎊 +1 overall
This message was automatically generated. |
Updated the PR to deprecate the static defines and the default constructors (for consistency). Because I was already on it, I added some test cases for the types. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
No description provided.