Package org.apache.hadoop.hdfs

Examples of org.apache.hadoop.hdfs.MiniDFSClusterWithNodeGroup.waitActive()


      MiniDFSClusterWithNodeGroup.setNodeGroups(nodeGroup1);
      // start the dfs cluster with datanode1 only.
      dfs = new MiniDFSClusterWithNodeGroup(0, conf, 1,
                true, true, null, rack1, hosts1, null);

      dfs.waitActive();
      fileSys = dfs.getFileSystem();
      if (!fileSys.mkdirs(inDir)) {
        throw new IOException("Mkdirs failed to create " + inDir.toString());
      }
      // write file1 on datanode1 with 1 replica
View Full Code Here


      UtilsForTests.writeFile(
          dfs.getNameNode(), conf, new Path(inDir + "/file1"), (short)1);
      // start another two datanodes (2 and 3)
      dfs.startDataNodes(conf, 2, true, null, rack2, nodeGroup2, hosts2, null);

      dfs.waitActive();
      // write two files with 3 replica, so each datanodes will have one replica
      // of file2 and file3
      UtilsForTests.writeFile(
          dfs.getNameNode(), conf, new Path(inDir + "/file2"), (short)3);
      UtilsForTests.writeFile(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.