HDFS-15625: Namenode trashEmptier should not init ViewFs on startup (#2378). Contributed by Uma Maheswara Rao G.
This commit is contained in:
parent
2e46ef9417
commit
b76b36ebbc
|
@ -41,6 +41,7 @@ import org.apache.hadoop.ha.ServiceFailedException;
|
||||||
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
||||||
import org.apache.hadoop.hdfs.DFSUtil;
|
import org.apache.hadoop.hdfs.DFSUtil;
|
||||||
import org.apache.hadoop.hdfs.DFSUtilClient;
|
import org.apache.hadoop.hdfs.DFSUtilClient;
|
||||||
|
import org.apache.hadoop.hdfs.DistributedFileSystem;
|
||||||
import org.apache.hadoop.hdfs.HAUtil;
|
import org.apache.hadoop.hdfs.HAUtil;
|
||||||
import org.apache.hadoop.hdfs.HdfsConfiguration;
|
import org.apache.hadoop.hdfs.HdfsConfiguration;
|
||||||
import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
|
import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
|
||||||
|
@ -927,7 +928,9 @@ public class NameNode extends ReconfigurableBase implements
|
||||||
new PrivilegedExceptionAction<FileSystem>() {
|
new PrivilegedExceptionAction<FileSystem>() {
|
||||||
@Override
|
@Override
|
||||||
public FileSystem run() throws IOException {
|
public FileSystem run() throws IOException {
|
||||||
return FileSystem.get(conf);
|
FileSystem dfs = new DistributedFileSystem();
|
||||||
|
dfs.initialize(FileSystem.getDefaultUri(conf), conf);
|
||||||
|
return dfs;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.emptier = new Thread(new Trash(fs, conf).getEmptier(), "Trash Emptier");
|
this.emptier = new Thread(new Trash(fs, conf).getEmptier(), "Trash Emptier");
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class TestNNStartupWhenViewFSOverloadSchemeEnabled {
|
||||||
@Test(timeout = 30000)
|
@Test(timeout = 30000)
|
||||||
public void testHANameNodeAndDataNodeStartup() throws Exception {
|
public void testHANameNodeAndDataNodeStartup() throws Exception {
|
||||||
cluster = new MiniDFSCluster.Builder(CONF)
|
cluster = new MiniDFSCluster.Builder(CONF)
|
||||||
.nnTopology(MiniDFSNNTopology.simpleHATopology()).numDataNodes(1)
|
.nnTopology(MiniDFSNNTopology.simpleHATopology()).numDataNodes(0)
|
||||||
.waitSafeMode(false).build();
|
.waitSafeMode(false).build();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
cluster.transitionToActive(0);
|
cluster.transitionToActive(0);
|
||||||
|
@ -73,7 +73,7 @@ public class TestNNStartupWhenViewFSOverloadSchemeEnabled {
|
||||||
@Test(timeout = 30000)
|
@Test(timeout = 30000)
|
||||||
public void testNameNodeAndDataNodeStartup() throws Exception {
|
public void testNameNodeAndDataNodeStartup() throws Exception {
|
||||||
cluster =
|
cluster =
|
||||||
new MiniDFSCluster.Builder(CONF).numDataNodes(1).waitSafeMode(false)
|
new MiniDFSCluster.Builder(CONF).numDataNodes(0).waitSafeMode(false)
|
||||||
.build();
|
.build();
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue