Package org.apache.flink.core.fs

Examples of org.apache.flink.core.fs.Path


    // store properties
    final long oldTimeout = this.openTimeout;
    final int oldBufferSize = this.bufferSize;
    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


      bc = new BlobClient(serverAddress);

      for (final Iterator<Path> it = this.userJars.iterator(); it.hasNext();) {

        final Path jar = it.next();
        final FileSystem fs = jar.getFileSystem();
        FSDataInputStream is = null;
        try {
          is = fs.open(jar);
          final BlobKey key = bc.put(is);
          this.userJarBlobKeys.add(key);
View Full Code Here


  @Override
  public Path getWorkingDirectory() {

    return new Path(this.s3Uri);
  }
View Full Code Here

    try {
      final URI extendedUri = new URI(parentUri.getScheme(),
        ((parentUri.getAuthority() != null) ? parentUri.getAuthority() : ""), extendedPath,
        parentUri.getQuery(), parentUri.getFragment());
      return new Path(extendedUri);
    } catch (URISyntaxException e) {
      throw new IOException(StringUtils.stringifyException(e));
    }
  }
View Full Code Here

  }

  @Override
  public Path getWorkingDirectory() {

    return new Path(this.fs.getWorkingDirectory().toUri());
  }
View Full Code Here

        URI u = new URI(entry.filePath);
        if (!u.getPath().startsWith("/")) {
          u = new File(entry.filePath).toURI();
        }
        FileSystem fs = FileSystem.get(u);
        if (fs.exists(new Path(u.getPath()))) {
          this.cacheFile.put(name, new DistributedCacheEntry(u.toString(), entry.isExecutable));
        } else {
          throw new IOException("File " + u.toString() + " doesn't exist.");
        }
      } catch (URISyntaxException ex) {
View Full Code Here

  public void setCopyTasks(Map<String, FutureTask<Path>> cpTasks) {
      this.cacheCopyTasks = cpTasks;
  }

  public File getFile(String name) {
    Path tmp = null;
    //The FutureTask.get() method will block until the file is ready.
    try {
      tmp = cacheCopyTasks.get(name).get();
    } catch (Exception  e) {
      throw new RuntimeException("Error while getting file from distributed cache", e);
    }
    return new File(tmp.toString());
  }
View Full Code Here

    final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats instanceof FileBaseStatistics) ?
      (FileBaseStatistics) cachedStats : null;

    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

   * @param fs
   *        the file system the corresponding file has been read from
   */
  public LocalFileStatus(final File f, final FileSystem fs) {
    this.file = f;
    this.path = new Path(fs.getUri().getScheme() + ":" + f.toURI().getPath());
  }
View Full Code Here

  /**
   * Constructs a new <code>LocalFileSystem</code> object.
   */
  public LocalFileSystem() {
    this.workingDir = new Path(System.getProperty("user.dir")).makeQualified(this);

    String tmp = "unknownHost";

    try {
      tmp = InetAddress.getLocalHost().getHostName();
View Full Code Here

TOP

Related Classes of org.apache.flink.core.fs.Path

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.