@@ -77,7 +77,7 @@ public void teardown() throws Exception {
7777 @ Test
7878 public void testInvalidRegionServerHostnameAbortsServer () throws Exception {
7979 String invalidHostname = "hostAddr.invalid" ;
80- TEST_UTIL .getConfiguration ().set (DNS .RS_HOSTNAME_KEY , invalidHostname );
80+ TEST_UTIL .getConfiguration ().set (DNS .UNSAFE_RS_HOSTNAME_KEY , invalidHostname );
8181 HRegionServer hrs = null ;
8282 try {
8383 hrs = new HRegionServer (TEST_UTIL .getConfiguration ());
@@ -106,7 +106,7 @@ public void testRegionServerHostname() throws Exception {
106106 LOG .info ("Found " + hostName + " on " + ni + ", addr=" + addr );
107107
108108 TEST_UTIL .getConfiguration ().set (DNS .MASTER_HOSTNAME_KEY , hostName );
109- TEST_UTIL .getConfiguration ().set (DNS .RS_HOSTNAME_KEY , hostName );
109+ TEST_UTIL .getConfiguration ().set (DNS .UNSAFE_RS_HOSTNAME_KEY , hostName );
110110 StartMiniClusterOption option = StartMiniClusterOption .builder ()
111111 .numMasters (NUM_MASTERS ).numRegionServers (NUM_RS ).numDataNodes (NUM_RS ).build ();
112112 TEST_UTIL .startMiniCluster (option );
@@ -132,14 +132,23 @@ public void testRegionServerHostname() throws Exception {
132132 public void testDeprecatedConfigs () throws Exception {
133133 Configuration conf = TEST_UTIL .getConfiguration ();
134134 new HRegionServer (conf );
135- conf .setBoolean (HRegionServer .DEPRECATED_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false );
135+ conf .setBoolean (HRegionServer .RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false );
136136 assertFalse (conf .getBoolean (HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true ));
137- conf .setBoolean (HRegionServer .DEPRECATED_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true );
137+ conf .setBoolean (HRegionServer .RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true );
138138 assertTrue (conf .getBoolean (HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false ));
139139 conf .setBoolean (HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true );
140- assertTrue (conf .getBoolean (HRegionServer .DEPRECATED_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false ));
140+ assertTrue (conf .getBoolean (HRegionServer .RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false ));
141141 conf .setBoolean (HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , false );
142- assertFalse (conf .getBoolean (HRegionServer .DEPRECATED_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true ));
142+ assertFalse (conf .getBoolean (HRegionServer .RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true ));
143+
144+ conf .setBoolean (DNS .RS_HOSTNAME_KEY , false );
145+ assertFalse (conf .getBoolean (DNS .UNSAFE_RS_HOSTNAME_KEY , true ));
146+ conf .setBoolean (DNS .RS_HOSTNAME_KEY , true );
147+ assertTrue (conf .getBoolean (DNS .UNSAFE_RS_HOSTNAME_KEY , false ));
148+ conf .setBoolean (DNS .UNSAFE_RS_HOSTNAME_KEY , true );
149+ assertTrue (conf .getBoolean (DNS .RS_HOSTNAME_KEY , false ));
150+ conf .setBoolean (DNS .UNSAFE_RS_HOSTNAME_KEY , false );
151+ assertFalse (conf .getBoolean (DNS .RS_HOSTNAME_KEY , true ));
143152 }
144153
145154 @ Test
@@ -158,9 +167,9 @@ public void testConflictRegionServerHostnameConfigurationsAbortServer() throws E
158167 LOG .info ("Found " + hostName + " on " + ni );
159168
160169 TEST_UTIL .getConfiguration ().set (DNS .MASTER_HOSTNAME_KEY , hostName );
161- // "hbase.regionserver.hostname" and "hbase.unsafe.regionserver.hostname.disable.master.reversedns"
170+ // "hbase.unsafe. regionserver.hostname" and "hbase.unsafe.regionserver.hostname.disable.master.reversedns"
162171 // are mutually exclusive. Exception should be thrown if both are used.
163- TEST_UTIL .getConfiguration ().set (DNS .RS_HOSTNAME_KEY , hostName );
172+ TEST_UTIL .getConfiguration ().set (DNS .UNSAFE_RS_HOSTNAME_KEY , hostName );
164173 TEST_UTIL .getConfiguration ().setBoolean (HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY , true );
165174 try {
166175 StartMiniClusterOption option = StartMiniClusterOption .builder ()
@@ -171,7 +180,7 @@ public void testConflictRegionServerHostnameConfigurationsAbortServer() throws E
171180 Throwable t2 = t1 .getCause ();
172181 assertTrue (t1 .getMessage ()+" - " +t2 .getMessage (), t2 .getMessage ().contains (
173182 HRegionServer .UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY + " and " +
174- DNS .RS_HOSTNAME_KEY + " are mutually exclusive" ));
183+ DNS .UNSAFE_RS_HOSTNAME_KEY + " are mutually exclusive" ));
175184 return ;
176185 } finally {
177186 TEST_UTIL .shutdownMiniCluster ();
0 commit comments