Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FsShell.run()


          FileSystem fs2 = oldPath.getFileSystem(conf);
          if (fs2.exists(oldPath)) {
            // use FsShell to move data to .Trash first rather than delete permanently
            FsShell fshell = new FsShell();
            fshell.setConf(conf);
            fshell.run(new String[]{"-rmr", oldPath.toString()});
          }
        } catch (Exception e) {
          //swallow the exception
          LOG.warn("Directory " + oldPath.toString() + " canot be removed.");
        }
View Full Code Here


          String[] args = new String[2];
          args[0] = "-cat";
          args[1] = "/test/mkdirs/myFile";
          int val = -1;
          try {
            val = shell.run(args);
            } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run: " +
                               StringUtils.stringifyException(e));
          }
          assertTrue(val == 0);
View Full Code Here

          args[0] = "-get";
          args[1] = "/test/mkdirs";
          args[2] = TEST_ROOT_DIR;
          int val = -1;
          try {
            val = shell.run(args);
            } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run " +
                               e.getLocalizedMessage());
          }
          assertTrue(val == 0);
View Full Code Here

          args[1] = "-crc";
          args[2] = "/test/mkdirs";
          args[3] = TEST_ROOT_DIR;
          int val = -1;
          try {
            val = shell.run(args);
            } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run " +
                               e.getLocalizedMessage());
          }
          assertTrue(val == 0);
View Full Code Here

          String[] args = new String[2];
          args[0] = "-cat";
          args[1] = "/test/mkdirs/myFile1";
          int val = -1;
          try {
            val = shell.run(args);
          } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run " +
                               e.getLocalizedMessage());
          }
          assertTrue(val != 0);
View Full Code Here

          String[] args = new String[2];
          args[0] = "-rm";
          args[1] = "/test/mkdirs/myFile1";
          int val = -1;
          try {
            val = shell.run(args);
          } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run " +
                               e.getLocalizedMessage());
          }
          assertTrue(val != 0);
View Full Code Here

          String[] args = new String[2];
          args[0] = "-rm";
          args[1] = "/test/mkdirs/myFile";
          int val = -1;
          try {
            val = shell.run(args);
          } catch (Exception e) {
            System.err.println("Exception raised from DFSShell.run " +
                               e.getLocalizedMessage());
          }
          assertTrue(val == 0);
View Full Code Here

      // Verify copying the tree
      {
        String[] args = {"-copyToLocal", "/test/copyToLocal", TEST_ROOT_DIR};
        try {
          assertEquals(0, shell.run(args));
        } catch (Exception e) {
          System.err.println("Exception raised from DFSShell.run " +
                             e.getLocalizedMessage());
        }
View Full Code Here

        String[] args = new String[2];
        args[0] = "-cat";
        args[1] = "/test/mkdirs/myFile";
        int val = -1;
        try {
          val = shell.run(args);
        } catch (Exception e) {
          System.err.println("Exception raised from DFSShell.run: " +
                             StringUtils.stringifyException(e));
        }
        assertTrue(val == 0);
View Full Code Here

        args[0] = "-get";
        args[1] = "/test/mkdirs";
        args[2] = TEST_ROOT_DIR;
        int val = -1;
        try {
          val = shell.run(args);
        } catch (Exception e) {
          System.err.println("Exception raised from DFSShell.run " +
                             e.getLocalizedMessage());
        }
        assertTrue(val == 0);
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.