Package org.apache.hadoop.fs

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


      // read the count from the jobtracker info file
      if (fs.exists(restartFile)) {
        fs.delete(tmpRestartFile, false); // delete the tmp file
      } else if (fs.exists(tmpRestartFile)) {
        // if .rec exists then delete the main file and rename the .rec to main
        fs.rename(tmpRestartFile, restartFile); // rename .rec to main file
      } else {
        // For the very first time the jobtracker will create a jobtracker.info
        // file. If the jobtracker has restarted then disable recovery as files'
        // needed for recovery are missing.
View Full Code Here


      // delete the main file
      fs.delete(restartFile, false);
     
      // rename the .rec to main file
      fs.rename(tmpRestartFile, restartFile);
    }

    public void recover() {
      if (!shouldRecover()) {
        // clean up jobs structure
View Full Code Here

      if (masterLogPath != null) {
        FileSystem fs = masterLogPath.getFileSystem(conf);
        if (fs.exists(tmpLogPath)) {
          LOG.info("Renaming " + tmpLogFileName + " to " + masterLogFileName
                   + " in user directory");
          fs.rename(tmpLogPath, masterLogPath);
        }
      }
    }

    /**
 
View Full Code Here

      } else {
        LOG.info(logFileName + " doesnt exist! Using "
                 + tmpFilename + " for recovery.");
        if (fs.exists(tmpFilePath)) {
          LOG.info("Renaming " + tmpFilename + " to " + logFileName);
          fs.rename(tmpFilePath, logFilePath);
          ret = tmpFilePath;
        } else {
          ret = logFilePath;
        }
      }
View Full Code Here

          LOG.info(logFileName + " doesnt exist! Using "
                   + tmpFilename + " as the master history file for user.");
          if (fs.exists(tmpFilePath)) {
            LOG.info("Renaming " + tmpFilename + " to " + logFileName
                     + " in user directory");
            fs.rename(tmpFilePath, logFilePath);
          }
        }
      }
     
      return ret;
View Full Code Here

        // rename the tmp file to the master file. Note that this should be
        // done only when the file is closed and handles are released.
        if(fs.exists(tmpLogPath)) {
          LOG.info("Renaming " + tmpLogFileName + " to " + masterLogFileName);
          fs.rename(tmpLogPath, masterLogPath);
        }
      }
     
      // do the same for the user file too
      masterLogPath =
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 hdfsIndexFile = new Path(FileOutputFormat.getOutputPath(_conf), _nodeId + ".index");
            Path hdfsValueFile = new Path(FileOutputFormat.getOutputPath(_conf), _nodeId + ".data");

            FileSystem fs = hdfsIndexFile.getFileSystem(_conf);
            fs.rename(taskIndexFileName, hdfsIndexFile);
            fs.rename(taskValueFileName, hdfsValueFile);
        }
    }

}
View Full Code Here

            Path hdfsIndexFile = new Path(FileOutputFormat.getOutputPath(_conf), _nodeId + ".index");
            Path hdfsValueFile = new Path(FileOutputFormat.getOutputPath(_conf), _nodeId + ".data");

            FileSystem fs = hdfsIndexFile.getFileSystem(_conf);
            fs.rename(taskIndexFileName, hdfsIndexFile);
            fs.rename(taskValueFileName, hdfsValueFile);
        }
    }

}
View Full Code Here

                             finalOutFileSize);
      Path finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(
                            getTaskId(), finalIndexFileSize);
     
      if (numSpills == 1) { //the spill is the final output
        localFs.rename(filename[0], finalOutputFile);
        localFs.rename(indexFileName[0], finalIndexFile);
        return;
      }
     
      //The output stream for the final single output file
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.