Uh oh!
There was an error while loading. Please reload this page.
HBASE-16002 Made constructors of DataType subclasses public - #157
Conversation
Apache-HBase
commented
Apr 16, 2019
🎊 +1 overall
This message was automatically generated. |
| public static final OrderedBlob DESCENDING = new OrderedBlob(Order.DESCENDING); | ||
| protected OrderedBlob(Order order) { | ||
| public OrderedBlob(Order order) { |
There was a problem hiding this comment.
I think this is intentional? User can use the above ASCENDING and DESCENDING directly?
There was a problem hiding this comment.
I would guess so. @ndimiduk probably can answer this question better.
There was a problem hiding this comment.
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.
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.
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.
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?
Apache-HBase
commented
Apr 20, 2019
🎊 +1 overall
This message was automatically generated. |
saintstack
commented
Jun 7, 2019
IMO make all constructors public (and deprecate the static defines). Its consistent. If a problem w/ too many new objects, can review then. |
Apache-HBase
commented
Jun 11, 2019
🎊 +1 overall
This message was automatically generated. |
HorizonNet
commented
Jun 16, 2019
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. |
Apache-HBase
commented
Jun 16, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jun 16, 2019
🎊 +1 overall
This message was automatically generated. |
No description provided.