Package org.apache.hadoop.fs

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


        logger.info("Moving " + this.taskIndexFileName + " to " + indexFile);
        if(outputFs.exists(indexFile)) {
            outputFs.delete(indexFile);
        }
        outputFs.rename(taskIndexFileName, indexFile);

        logger.info("Moving " + this.taskValueFileName + " to " + valueFile);
        if(outputFs.exists(valueFile)) {
            outputFs.delete(valueFile);
        }
View Full Code Here


        logger.info("Moving " + this.taskValueFileName + " to " + valueFile);
        if(outputFs.exists(valueFile)) {
            outputFs.delete(valueFile);
        }
        outputFs.rename(this.taskValueFileName, valueFile);
    }

}
View Full Code Here

    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());
    Path newPath = new Path(path.getParent(), "bar");
    fs.rename(oldPath, newPath);
    fs.close();
    fs = FileSystem.get(getHadoopConf());
    Assert.assertFalse(fs.exists(oldPath));
    Assert.assertTrue(fs.exists(newPath));
    fs.close();
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

      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

      {
        ZipUtils.zip(fs, tmpath, fs, tmpathzip);
       
        if (!fs.exists(new Path(indexHdfsPath))) {
         
          fs.rename(new Path(tmpathzip), new Path(indexHdfsPath));
        }
      }else{
          if (!fs.exists(new Path(indexHdfsPath))) {
          fs.rename(new Path(tmpath), new Path(indexHdfsPath));
        }
View Full Code Here

         
          fs.rename(new Path(tmpathzip), new Path(indexHdfsPath));
        }
      }else{
          if (!fs.exists(new Path(indexHdfsPath))) {
          fs.rename(new Path(tmpath), new Path(indexHdfsPath));
        }
      }

    } catch (Throwable e) {
      throw new IOException(e);
View Full Code Here

      Configuration conf = context.getConfiguration();
      FileSystem fs = FileSystem.get(conf);
      fs.copyFromLocalFile(new Path(localtmpath), new Path(tmpath));

      if (!fs.exists(new Path(indexHdfsPath))) {
        fs.rename(new Path(tmpath), new Path(indexHdfsPath));
      }
      if (shardWriter.getNumDocs() > 0 && lastkey != null) {
        TaskID taskId = context.getTaskAttemptID().getTaskID();
        int partition = taskId.getId();
        System.out.println("###########>>>>"+partition);
View Full Code Here

        br.close();

        writer.close();
        reader.close();
        fs.delete(filepath, true);
        fs.rename(randompath, filepath);
      } catch (Exception e) {
        fs.delete(randompath, true);
      }
    }
    }
View Full Code Here

       
        for( FileStatus outpath:fs.listStatus(new Path(store)))
        {
          if(!outpath.isDir())
          {
            fs.rename(outpath.getPath(), new Path(txtpath,outpath.getPath().getName()+"_"+System.currentTimeMillis()));
          }
        }
        fs.delete(new Path(store),true);
       
        Path basepath=new Path(MdrillService.getBasePath());
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.