Skip to content

Commit 92b0436

Browse files
author
xiezhineng
committed
fix unit test
1 parent 10821d0 commit 92b0436

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithHANameNodes.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
package org.apache.hadoop.hdfs.server.balancer;
1919

2020
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY;
21-
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_HA_ALLOW_STALE_READ_DEFAULT;
22-
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_HA_ALLOW_STALE_READ_KEY;
23-
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_HA_TAILEDITS_PERIOD_KEY;
21+
import static org.apache.hadoop.hdfs.DFSConfigKeys.*;
2422
import static org.junit.Assert.assertEquals;
2523
import static org.junit.Assert.assertTrue;
2624
import static org.mockito.ArgumentMatchers.any;
@@ -147,7 +145,8 @@ void doTest(Configuration conf, boolean withHA) throws Exception {
147145
/ numOfDatanodes, (short) numOfDatanodes, 0);
148146

149147
boolean isRequestStandby = conf.getBoolean(
150-
DFS_HA_ALLOW_STALE_READ_KEY, DFS_HA_ALLOW_STALE_READ_DEFAULT);
148+
DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_KEY,
149+
DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_DEFAULT);
151150
if (isRequestStandby) {
152151
HATestUtil.waitForStandbyToCatchUp(cluster.getNameNode(0),
153152
cluster.getNameNode(1));
@@ -182,7 +181,7 @@ void doTest(Configuration conf, boolean withHA) throws Exception {
182181
@Test(timeout = 60000)
183182
public void testBalancerRequestSBNWithHA() throws Exception {
184183
Configuration conf = new HdfsConfiguration();
185-
conf.setBoolean(DFS_HA_ALLOW_STALE_READ_KEY, true);
184+
conf.setBoolean(DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_KEY, false);
186185
conf.setLong(DFS_HA_TAILEDITS_PERIOD_KEY, 1);
187186
//conf.setBoolean(DFS_HA_BALANCER_REQUEST_STANDBY_KEY, true);
188187
TestBalancer.initConf(conf);
@@ -329,8 +328,8 @@ nsId, new Path("/test"),
329328
nncActive.close();
330329

331330
// Request to standby namenode.
332-
conf.setBoolean(DFSConfigKeys.DFS_HA_ALLOW_STALE_READ_KEY,
333-
true);
331+
conf.setBoolean(DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_KEY,
332+
false);
334333
NameNodeConnector nncStandby = new NameNodeConnector(
335334
"nncStandby", namenode,
336335
nsId, new Path("/test"),

0 commit comments

Comments
 (0)