Package org.apache.flink.core.fs

Examples of org.apache.flink.core.fs.Path.toUri()


    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

      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

      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

   
    // get the file info and check whether the cached statistics are still valid.
    for(org.apache.hadoop.fs.Path hadoopPath : hadoopFilePaths) {
     
      final Path filePath = new Path(hadoopPath.toUri());
      final FileSystem fs = FileSystem.get(filePath.toUri());
     
      final FileStatus file = fs.getFileStatus(filePath);
      latestModTime = Math.max(latestModTime, file.getModificationTime());
     
      // enumerate all files and check their modification time stamp.
View Full Code Here

   
    // get the file info and check whether the cached statistics are still valid.
    for(org.apache.hadoop.fs.Path hadoopPath : hadoopFilePaths) {
     
      final Path filePath = new Path(hadoopPath.toUri());
      final FileSystem fs = FileSystem.get(filePath.toUri());
     
      final FileStatus file = fs.getFileStatus(filePath);
      latestModTime = Math.max(latestModTime, file.getModificationTime());
     
      // enumerate all files and check their modification time stamp.
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

    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.