Package eu.stratosphere.core.fs

Examples of eu.stratosphere.core.fs.Path.toUri()


      throw new InvalidProgramException("File path of FileDataSink is empty string.");
    }
   
    try {
      Path p = new Path(path);
      String scheme = p.toUri().getScheme();
     
      if (scheme == null) {
        throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink has no file system scheme (like 'file:// or hdfs://').");
      }
    } catch (Exception e) {
View Full Code Here


      throw new InvalidProgramException("File path of FileDataSource is empty string.");
    }
   
    try {
      Path p = new Path(path);
      String scheme = p.toUri().getScheme();
     
      if (scheme == null) {
        throw new InvalidProgramException("File path \"" + path + "\" of FileDataSource has no file system scheme (like 'file:// or hdfs://').");
      }
    } catch (Exception e) {
View Full Code Here

            throw new IOException(requiredJarFiles[i] + " does not exist in the library cache");
          }

          // Add file to the URL array
          try {
            urls[i] = p.toUri().toURL();
          } catch (MalformedURLException e) {
            throw new IOException(StringUtils.stringifyException(e));
          }
        }
      }
View Full Code Here

  @Override
  public void invoke() throws Exception {

    Path outputPath = getFileOutputPath();

    FileSystem fs = FileSystem.get(outputPath.toUri());
    if (fs.exists(outputPath)) {
      FileStatus status = fs.getFileStatus(outputPath);

      if (status.isDir()) {
        outputPath = new Path(outputPath.toUri().toString() + "/file_" + getIndexInSubtaskGroup() + ".txt");
View Full Code Here

    FileSystem fs = FileSystem.get(outputPath.toUri());
    if (fs.exists(outputPath)) {
      FileStatus status = fs.getFileStatus(outputPath);

      if (status.isDir()) {
        outputPath = new Path(outputPath.toUri().toString() + "/file_" + getIndexInSubtaskGroup() + ".txt");
      }
    }

    final FSDataOutputStream outputStream = fs.create(outputPath, true);
View Full Code Here

      fs.delete(bucketPath, true);

      // Make sure the bucket no longer exists
      try {
        fs.getFileStatus(bucketPath);
        fail("Expected FileNotFoundException for " + bucketPath.toUri());
      } catch (FileNotFoundException e) {
        // This is an expected exception
      }

    } catch (IOException ioe) {
View Full Code Here

    final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats instanceof FileBaseStatistics) ?
      (FileBaseStatistics) cachedStats : null;
       
    try {
      final Path path = this.filePath;
      final FileSystem fs = FileSystem.get(path.toUri());
     
      return getFileStats(cachedFileStats, path, fs, new ArrayList<FileStatus>(1));
    } catch (IOException ioex) {
      if (LOG.isWarnEnabled()) {
        LOG.warn("Could not determine statistics for file '" + this.filePath + "' due to an io error: "
View Full Code Here

    inputFormat.setFilePath(normalizedPath);
    inputFormat.setOpenTimeout(0);
    inputFormat.configure(configuration);

    final FileSystem fs = FileSystem.get(normalizedPath.toUri());
    FileStatus fileStatus = fs.getFileStatus(normalizedPath);

    BlockLocation[] blocks = fs.getFileBlockLocations(fileStatus, 0, fileStatus.getLen());
    inputFormat.open(new FileInputSplit(0, new Path(path), 0, fileStatus.getLen(), blocks[0].getHosts()));
    return inputFormat;
View Full Code Here

    try {
      final Path filePath = this.filePath;

      // get the filesystem
      final FileSystem fs = FileSystem.get(filePath.toUri());
      final ArrayList<FileStatus> allFiles = new ArrayList<FileStatus>(1);

      // let the file input format deal with the up-to-date check and the basic size
      final FileBaseStatistics stats = getFileStats(cachedFileStats, filePath, fs, allFiles);
      if (stats == null) {
View Full Code Here

    final int oldLineLengthLimit = this.lineLengthLimit;
    try {
      final Path filePath = this.filePath;
   
      // get the filesystem
      final FileSystem fs = FileSystem.get(filePath.toUri());
      final ArrayList<FileStatus> allFiles = new ArrayList<FileStatus>(1);
     
      // let the file input format deal with the up-to-date check and the basic size
      final FileBaseStatistics stats = getFileStats(cachedFileStats, filePath, fs, allFiles);
      if (stats == null) {
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.