-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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-25861 Correct the usage of Configuration#addDeprecation #3249
Conversation
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
@ZhaoBQ this change is great!
My comments are entirely around preserving and not growing our public API surface area. You touch several classes that are InterfaceAudience.Public
, so care must be taken to not alter their APIs.
One other idea: with javdoc, you can use '{@value ...}'
instead of {@link ...}
and the value of the constant will be generated into the Javadoc. In this case, printing the rendered string value of the configuration point is preferable to the symbol expression that stores the value. For an example look in org.apache.hadoop.hbase.master.normalizer.package-info.java
.
*/ | ||
@Deprecated | ||
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG) | ||
public static final String RS_HOSTNAME_KEY = "hbase.regionserver.hostname"; |
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.
There's no reason to add all these constants to this HConstants
class; it's better if we don't expand our public interface if we can avoid it. I think it would be better to use the configuration string values directly in the new HBaseConfiguration#addDeprecatedKeys()
.
Please do preserve the comments about removal target release.
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 agree w/ the Nick comment.
This file of all the constants is a bit of an anti-pattern... should have gone away long ago.... Was hoping it would shrivel but it hasn't. Don't pour water on it (smile).
@@ -18,6 +18,12 @@ | |||
|
|||
package org.apache.hadoop.hbase.io; | |||
|
|||
import static org.apache.hadoop.hbase.HConstants.ALLOCATOR_POOL_ENABLED_KEY; |
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.
My above suggestion would mean that these symbols simply don't exist anymore for tests to make use of. I think this is preferable, if test's make use of the "public" api of the product, not the classes. This way, if a configuration key is changed in the class, and that configuration key is used by value in the test, the test would presumably fail.
So in this case, the test will define new constants that contain these configuration key strings.
@@ -40,8 +40,7 @@ | |||
public static final String MOB_DIR_NAME = "mobdir"; | |||
public static final String MOB_REGION_NAME = ".mob"; | |||
public static final byte[] MOB_REGION_NAME_BYTES = Bytes.toBytes(MOB_REGION_NAME); | |||
public static final String MOB_CLEANER_PERIOD = "hbase.master.mob.cleaner.period"; |
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.
Unfortunately this class in InterfaceAudience.Public
, so these symbols cannot change.
Thanks @ndimiduk and @saintstack for review. It's cleaner after using the configuration string values directly in the HBaseConfiguration#addDeprecatedKeys(). |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Yes, this looks much better. It seems the test failure is related though, mind taking a look? If the jenkins test result screen doesn't include enough information for you, you can download all the test logs. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
The failed UTs can pass in my local env. |
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 agree these test failures look unrelated.
I have one more request of you for this change, which is to preserve the comments regarding the deprecations in their new location. The reason is we will eventually file tickets to remove the old configs, and it's important to track when the deprecations were first added. These comments will help future maintainers track the exact version when the old configs can be deleted.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Show resolved
Hide resolved
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java
Show resolved
Hide resolved
…t configured, the logs will still be printed
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…#3249) Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
…#3249) Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Baiqiang Zhao <zbq.dean@gmail.com> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
No description provided.