Package org.apache.hadoop.fs

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


        fs.mkdirs(dst.getParent());
        LOG.info("Trying to sildeline reference file "
          + path + " to " + dst);
        setShouldRerun();

        success = fs.rename(path, dst);
      }
      if (!success) {
        LOG.error("Failed to sideline reference file " + path);
      }
    }
View Full Code Here


      // FileSystem.rename is inconsistent with directories -- if the
      // dst (foo/a) exists and is a dir, and the src (foo/b) is a dir,
      // it moves the src into the dst dir resulting in (foo/a/b).  If
      // the dst does not exist, and the src a dir, src becomes dst. (foo/b)
      for (FileStatus hfile : fs.listStatus(src)) {
        boolean success = fs.rename(hfile.getPath(), dst);
        if (success) {
          fileMoves++;
        }
      }
      LOG.debug("Sideline directory contents:");
View Full Code Here

                   filesUser, filesGroup, filesMode, mappers);
      }

      // Step 3 - Rename fs2:/.snapshot/.tmp/<snapshot> fs2:/.snapshot/<snapshot>
      LOG.info("Finalize the Snapshot Export");
      if (!outputFs.rename(snapshotTmpDir, outputSnapshotDir)) {
        throw new ExportSnapshotException("Unable to rename snapshot directory from=" +
          snapshotTmpDir + " to=" + outputSnapshotDir);
      }

      // Step 4 - Verify snapshot validity
View Full Code Here

    setup(context);
    FileSystem fileSystem = _newIndex.getFileSystem(_configuration);
    if (fileSystem.exists(_newIndex) && !fileSystem.isFile(_newIndex)) {
      Path dst = new Path(_indexPath, _taskAttemptID.toString() + ".task_complete");
      LOG.info("Committing [{0}] to [{1}]", _newIndex, dst);
      fileSystem.rename(_newIndex, dst);
    } else {
      throw new IOException("Path [" + _newIndex + "] does not exist, can not commit.");
    }
  }
View Full Code Here

        fs.mkdirs(dst.getParent());
        LOG.info("Trying to sildeline reference file"
          + path + " to " + dst);
        setShouldRerun();

        success = fs.rename(path, dst);
      }
      if (!success) {
        LOG.error("Failed to sideline reference file " + path);
      }
    }
View Full Code Here

      // FileSystem.rename is inconsistent with directories -- if the
      // dst (foo/a) exists and is a dir, and the src (foo/b) is a dir,
      // it moves the src into the dst dir resulting in (foo/a/b).  If
      // the dst does not exist, and the src a dir, src becomes dst. (foo/b)
      for (FileStatus hfile : fs.listStatus(src)) {
        boolean success = fs.rename(hfile.getPath(), dst);
        if (success) {
          fileMoves++;
        }
      }
      LOG.debug("[" + thread + "] Sideline directory contents:");
View Full Code Here

          //resolve the final filename against the directory where the tmpFile
          //got created
          filename = new Path(tmpFilename.getParent(), filename.getName());
          // if we can't rename the file, something is broken (and IOException
          // will be thrown).
          if (!fs.rename(tmpFilename, filename)) {
            fs.delete(tmpFilename);
            bytes = -1;
            throw new IOException("failure to rename map output " +
                                  tmpFilename);
          }
View Full Code Here

      Path hbaseTableDir = new Path(conf.get(HConstants.HBASE_DIR) + "/" + table );
      fs = hbaseTableDir.getFileSystem(conf);
      FileStatus status = FSTableDescriptors.getTableInfoPath(fs, hbaseTableDir);
      tableinfo = status.getPath();
      fs.rename(tableinfo, new Path("/.tableinfo"));

      //to report error if .tableinfo is missing.
      HBaseFsck hbck = doFsck(conf, false);
      assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.NO_TABLEINFO_FILE });
View Full Code Here

      status = FSTableDescriptors.getTableInfoPath(fs, hbaseTableDir);
      assertNotNull(status);
      htd = admin.getTableDescriptor(table.getBytes());
      assertEquals(htd.getValue("NOT_DEFAULT"), "true");
    } finally {
      fs.rename(new Path("/.tableinfo"), tableinfo);
      deleteTable(table);
    }
  }

  /**
 
View Full Code Here

              Path hfileStagingPath = null;
              Path hfileOrigPath = new Path(el.getSecond());
              try {
                hfileStagingPath= new Path(secureClient.getStagingPath(bulkToken, el.getFirst()),
                    hfileOrigPath.getName());
                if(fs.rename(hfileStagingPath, hfileOrigPath)) {
                  LOG.debug("Moved back file " + hfileOrigPath + " from " +
                      hfileStagingPath);
                } else if(fs.exists(hfileStagingPath)){
                  LOG.debug("Unable to move back file " + hfileOrigPath + " from " +
                      hfileStagingPath);
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.