Package org.springframework.data.hadoop

Examples of org.springframework.data.hadoop.HadoopException


    Method registerScript = ReflectionUtils.findMethod(PigServer.class, "registerScript", InputStream.class, Map.class);
    if (registerScript != null) {
      ReflectionUtils.invokeMethod(registerScript, pig, in, arguments);
    }
    else {
      throw new HadoopException("Pig versions older than 0.8.0 are not supported.");
    }

  }
View Full Code Here


        ReflectionUtils.invokeMethod(m, target, args);
        m = ReflectionUtils.findMethod(cmd, "processRawArguments", LinkedList.class);
        ReflectionUtils.makeAccessible(m);
        ReflectionUtils.invokeMethod(m, target, args);
      } catch (IllegalStateException ex){
        throw new HadoopException("Cannot change permissions/ownership " + ex);
      }
    }
  }
View Full Code Here

    try {
      this.fs = (fs != null ? fs : FileSystem.get(configuration));
      this.internalFs = (fs == null);
      this.trash = new Trash(configuration);
    } catch (IOException ex) {
      throw new HadoopException("Cannot create shell " + ex.getMessage(), ex);
    }
  }
View Full Code Here

          FileSystem srcFS = getFS(src);
          results.addAll(Arrays.asList(FileUtil.stat2Paths(srcFS.globStatus(src), src)));
        }
      }
    } catch (IOException ex) {
      throw new HadoopException("Cannot execute command " + ex.getMessage(), ex);
    }

    return Collections.unmodifiableCollection(results);
  }
View Full Code Here

    try {
      FileSystem dstFs = getFS(dstPath);
      dstFs.copyFromLocalFile(false, false, srcs.toArray(new Path[srcs.size()]), dstPath);
    } catch (IOException ex) {
      throw new HadoopException("Cannot copy resources " + ex.getMessage(), ex);
    }
  }
View Full Code Here

        Path p = status.getPath();
        File f = dstIsDir ? new File(dst, p.getName()) : dst;
        copyToLocal(srcFs, p, f, crc);
      }
    } catch (IOException ex) {
      throw new HadoopException("Cannot copy resources " + ex.getMessage(), ex);
    }
  }
View Full Code Here

        for (FileStatus s : statuses) {
          Path p = s.getPath();
          results.put(p, fs.getContentSummary(p));
        }
      } catch (IOException ex) {
        throw new HadoopException("Cannot find listing " + ex.getMessage(), ex);
      }
    }

    return Collections.unmodifiableMap(results);
  }
View Full Code Here

        for (Path fromPath : from) {
          FileUtil.copy(srcFs, fromPath, dstFs, dstPath, false, configuration);
        }
      }
    } catch (IOException ex) {
      throw new HadoopException("Cannot copy resources " + ex.getMessage(), ex);
    }
  }
View Full Code Here

          }
        }
        else {
          FileStatus items[] = srcFs.listStatus(FileUtil.stat2Paths(fileStatus, srcPath));
          if (ObjectUtils.isEmpty(items) && (!srcFs.exists(srcPath))) {
            throw new HadoopException("Cannot access " + src + ": No such file or directory.");
          }
          for (FileStatus status : items) {
            Long size = (status.isDir() ? srcFs.getContentSummary(status.getPath()).getLength() : status.getLen());
            results.put(status.getPath(), size);
          }
        }
      }
    } catch (IOException ex) {
      throw new HadoopException("Cannot inspect resources " + ex.getMessage(), ex);
    }

    return Collections.unmodifiableMap(results);
  }
View Full Code Here

  public void expunge() {
    try {
      trash.expunge();
      trash.checkpoint();
    } catch (IOException ex) {
      throw new HadoopException("Cannot expunge trash" + ex.getMessage(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.HadoopException

Copyright © 2018 www.massapicom. 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.