HBASE-25928 TestHBaseConfiguration#testDeprecatedConfigurations is broken with Hadoop 3.3 (#3320)
Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org> Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
b4e8b91414
commit
a1cac20e95
|
@ -92,6 +92,11 @@ public class HBaseConfiguration extends Configuration {
|
|||
* HBASE-24667: This config hbase.regionserver.hostname.disable.master.reversedns will be
|
||||
* replaced by hbase.unsafe.regionserver.hostname.disable.master.reversedns. Keep the old config
|
||||
* keys here for backward compatibility.
|
||||
* <br>
|
||||
* Note: Before Hadoop-3.3, we must call the addDeprecations method before creating the
|
||||
* Configuration object to work correctly. After this bug is fixed in hadoop-3.3, there will be
|
||||
* no order problem.
|
||||
* @see <a href="https://issues.apache.org/jira/browse/HADOOP-15708">HADOOP-15708</a>
|
||||
*/
|
||||
private static void addDeprecatedKeys() {
|
||||
Configuration.addDeprecations(new DeprecationDelta[]{
|
||||
|
|
|
@ -137,17 +137,13 @@ public class TestHBaseConfiguration {
|
|||
public void testDeprecatedConfigurations() {
|
||||
// Configuration.addDeprecations before create Configuration object
|
||||
Configuration.addDeprecations(new Configuration.DeprecationDelta[]{
|
||||
new Configuration.DeprecationDelta("hbase.deprecated.conf", "hbase.new.conf")
|
||||
new Configuration.DeprecationDelta("hbase.deprecated.conf", "hbase.new.conf"),
|
||||
new Configuration.DeprecationDelta("hbase.deprecated.conf2", "hbase.new.conf2")
|
||||
});
|
||||
Configuration conf = HBaseConfiguration.create();
|
||||
conf.addResource("hbase-deprecated-conf.xml");
|
||||
assertEquals("1000", conf.get("hbase.new.conf"));
|
||||
|
||||
// Configuration.addDeprecations after create Configuration object
|
||||
Configuration.addDeprecations(new Configuration.DeprecationDelta[]{
|
||||
new Configuration.DeprecationDelta("hbase.deprecated.conf2", "hbase.new.conf2")
|
||||
});
|
||||
assertNull(conf.get("hbase.new.conf2"));
|
||||
assertEquals("1000", conf.get("hbase.new.conf2"));
|
||||
}
|
||||
|
||||
private static class ReflectiveCredentialProviderClient {
|
||||
|
|
Loading…
Reference in New Issue