org.apache.hadoop.hive.ql.metadata.Hive.moveFile()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.moveFile()方法的一些代码示例,展示了Hive.moveFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.moveFile()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:moveFile

Hive.moveFile介绍

暂无

代码示例

代码示例来源:origin: apache/hive

private Path moveResultsToCacheDirectory(Path queryResultsPath) throws IOException {
 String dirName = UUID.randomUUID().toString();
 Path cachedResultsPath = new Path(cacheDirPath, dirName);
 FileSystem fs = cachedResultsPath.getFileSystem(conf);
 try {
  boolean resultsMoved = Hive.moveFile(conf, queryResultsPath, cachedResultsPath, false, false, false);
  if (!resultsMoved) {
   throw new IOException("Failed to move " + queryResultsPath + " to " + cachedResultsPath);
  }
 } catch (IOException err) {
  throw err;
 } catch (Exception err) {
  throw new IOException("Error moving " + queryResultsPath + " to " + cachedResultsPath, err);
 }
 return cachedResultsPath;
}

代码示例来源:origin: apache/hive

if (!Hive.moveFile(conf, sourcePath, targetPath, true, false, false)) {
 try {
  if (deletePath != null) {

代码示例来源:origin: apache/drill

private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
  throws HiveException, IOException {
 // if source exists, rename. Otherwise, create a empty directory
 if (fs.exists(sourcePath)) {
  Path deletePath = null;
  // If it multiple level of folder are there fs.rename is failing so first
  // create the targetpath.getParent() if it not exist
  if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
   deletePath = createTargetPath(targetPath, fs);
  }
  Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
  if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
   try {
    if (deletePath != null) {
     fs.delete(deletePath, true);
    }
   } catch (IOException e) {
    LOG.info("Unable to delete the path created for facilitating rename"
      + deletePath);
   }
   throw new HiveException("Unable to rename: " + sourcePath
     + " to: " + targetPath);
  }
 } else if (!fs.mkdirs(targetPath)) {
  throw new HiveException("Unable to make directory: " + targetPath);
 }
}

代码示例来源:origin: apache/hive

if (!moveFile(conf, srcs[0].getPath(), destf, true, isSrcLocal, isManaged)) {
 throw new IOException("Error moving: " + srcf + " into: " + destf);

代码示例来源:origin: apache/drill

if (!moveFile(conf, srcs[0].getPath(), destf, true, isSrcLocal)) {
 throw new IOException("Error moving: " + srcf + " into: " + destf);
 if (!moveFile(conf, src.getPath(), new Path(destf, src.getPath().getName()), true, isSrcLocal)) {
  throw new IOException("Error moving: " + srcf + " into: " + destf);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

if (!moveFile(conf, sdpair[0], sdpair[1], destFs, true, isSrcLocal)) {
 throw new IOException("Unable to move file/directory from " + sdpair[0] +
   " to " + sdpair[1]);
if (!moveFile(conf, sdpair[0], sdpair[1], destFs, true,
  isSrcLocal)) {
 throw new IOException("Error moving: " + sdpair[0] + " into: " + sdpair[1]);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

for (List<Path[]> sdpairs : result) {
 for (Path[] sdpair : sdpairs) {
  if (!moveFile(conf, sdpair[0], sdpair[1], fs, false, isSrcLocal)) {
   throw new IOException("Cannot move " + sdpair[0] + " to "
     + sdpair[1]);

代码示例来源:origin: com.facebook.presto.hive/hive-apache

deletePath = createTargetPath(targetPath, fs);
if (!Hive.moveFile(conf, sourcePath, targetPath, fs, true, false)) {
 try {
  if (deletePath != null) {

相关文章

Hive类方法