Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.mkdirs()


  }

  private void testRename() throws Exception {
    FileSystem fs = FileSystem.get(getHadoopConf());
    Path path = new Path(getHadoopTestDir(), "foo");
    fs.mkdirs(path);
    fs.close();
    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
    fs = FileSystem.get(getJettyURL().toURI(), conf);
    Path oldPath = new Path(path.toUri().getPath());
View Full Code Here


  private void testDelete() throws Exception {
    Path foo = new Path(getHadoopTestDir(), "foo");
    Path bar = new Path(getHadoopTestDir(), "bar");
    Path foe = new Path(getHadoopTestDir(), "foe");
    FileSystem fs = FileSystem.get(getHadoopConf());
    fs.mkdirs(foo);
    fs.mkdirs(new Path(bar, "a"));
    fs.mkdirs(foe);

    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
View Full Code Here

    Path foo = new Path(getHadoopTestDir(), "foo");
    Path bar = new Path(getHadoopTestDir(), "bar");
    Path foe = new Path(getHadoopTestDir(), "foe");
    FileSystem fs = FileSystem.get(getHadoopConf());
    fs.mkdirs(foo);
    fs.mkdirs(new Path(bar, "a"));
    fs.mkdirs(foe);

    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
    FileSystem hoopFs = FileSystem.get(getJettyURL().toURI(), conf);
View Full Code Here

    Path bar = new Path(getHadoopTestDir(), "bar");
    Path foe = new Path(getHadoopTestDir(), "foe");
    FileSystem fs = FileSystem.get(getHadoopConf());
    fs.mkdirs(foo);
    fs.mkdirs(new Path(bar, "a"));
    fs.mkdirs(foe);

    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
    FileSystem hoopFs = FileSystem.get(getJettyURL().toURI(), conf);
    Assert.assertTrue(hoopFs.delete(new Path(foo.toUri().getPath()), false));
View Full Code Here

          Path testDir = new Path("./" + TEST_DIR_ROOT, getTestUniqueName(iInvokedMethod.getTestMethod()));
          try {
            // currentUser
            FileSystem fs = FileSystem.get(HADOOP_CONF);
            fs.delete(testDir, true);
            fs.mkdirs(testDir);

            // proxusers
            for (String user : getHadoopUsers()) {
              createHadoopTempDir(user, testDir);
            }
View Full Code Here

      ugi.doAs(new PrivilegedExceptionAction<Void>() {
        @Override
        public Void run() throws Exception {
          FileSystem fs = FileSystem.get(HADOOP_CONF);
          fs.delete(testDir, true);
          fs.mkdirs(testDir);
          return null;
        }
      });
    }
View Full Code Here

  private void testMkdirs() throws Exception {
    Path path = new Path(getHadoopTestDir(), "foo");
    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
    FileSystem fs = FileSystem.get(getJettyURL().toURI(), conf);
    fs.mkdirs(path);
    fs.close();
    fs = FileSystem.get(getHadoopConf());
    Assert.assertTrue(fs.exists(path));
    fs.close();
  }
View Full Code Here

        UserGroupInformation.createUserForTesting(user, groups);
      }

      DFS_CLUSTER = new MiniDFSCluster(conf, dataNodes, true, null);
      FileSystem fileSystem = DFS_CLUSTER.getFileSystem();
      fileSystem.mkdirs(new Path("/tmp"));
      fileSystem.mkdirs(new Path("/user"));
      fileSystem.mkdirs(new Path("/hadoop/mapred/system"));
      fileSystem.setPermission(new Path("/tmp"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/user"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/hadoop/mapred/system"), FsPermission.valueOf("-rwx------"));
View Full Code Here

      }

      DFS_CLUSTER = new MiniDFSCluster(conf, dataNodes, true, null);
      FileSystem fileSystem = DFS_CLUSTER.getFileSystem();
      fileSystem.mkdirs(new Path("/tmp"));
      fileSystem.mkdirs(new Path("/user"));
      fileSystem.mkdirs(new Path("/hadoop/mapred/system"));
      fileSystem.setPermission(new Path("/tmp"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/user"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/hadoop/mapred/system"), FsPermission.valueOf("-rwx------"));
      String nnURI = fileSystem.getUri().toString();
View Full Code Here

      DFS_CLUSTER = new MiniDFSCluster(conf, dataNodes, true, null);
      FileSystem fileSystem = DFS_CLUSTER.getFileSystem();
      fileSystem.mkdirs(new Path("/tmp"));
      fileSystem.mkdirs(new Path("/user"));
      fileSystem.mkdirs(new Path("/hadoop/mapred/system"));
      fileSystem.setPermission(new Path("/tmp"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/user"), FsPermission.valueOf("-rwxrwxrwx"));
      fileSystem.setPermission(new Path("/hadoop/mapred/system"), FsPermission.valueOf("-rwx------"));
      String nnURI = fileSystem.getUri().toString();
      int numDirs = 1;
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.