Package org.apache.flink.core.fs

Examples of org.apache.flink.core.fs.FileSystem.listStatus()


    if(!acceptFile(pathFile)) {
      throw new IOException("The given file does not pass the file-filter");
    }
    if (pathFile.isDir()) {
      // input is directory. list all contained files
      final FileStatus[] dir = fs.listStatus(path);
      for (int i = 0; i < dir.length; i++) {
        if (!dir[i].isDir() && acceptFile(dir[i])) {
          files.add(dir[i]);
          totalLength += dir[i].getLen();
          // as soon as there is one deflate file in a directory, we can not split it
View Full Code Here


    FileSystem fs = nephelePath.getFileSystem();
    FileStatus fileStatus = fs.getFileStatus(nephelePath);
    if (!fileStatus.isDir()) {
      return Arrays.asList(openInput(inputFormatClass, path, configuration));
    }
    FileStatus[] list = fs.listStatus(nephelePath);
    List<F> formats = new ArrayList<F>();
    for (int index = 0; index < list.length; index++) {
      formats.add(openInput(inputFormatClass, list[index].getPath().toString(), configuration));
    }
    return formats;
View Full Code Here

      // Create directory
      fs.mkdirs(bucketPath);

      // Check if directory is correctly displayed in file system hierarchy
      final FileStatus[] content = fs.listStatus(new Path(S3_BASE_URI));
      boolean entryFound = false;
      for (final FileStatus entry : content) {
        if (bucketPath.equals(entry.getPath())) {
          entryFound = true;
          break;
View Full Code Here

      final OutputStream os = fs.create(file, true);
      generateTestData(os, SMALL_FILE_SIZE);
      os.close();

      // On this directory levels there should only be one subdirectory
      FileStatus[] list = fs.listStatus(dir);
      int numberOfDirs = 0;
      int numberOfFiles = 0;
      for (final FileStatus entry : list) {

        if (entry.isDir()) {
View Full Code Here

      }

      assertEquals(1, numberOfDirs);
      assertEquals(0, numberOfFiles);

      list = fs.listStatus(subdir);
      numberOfDirs = 0;

      for (final FileStatus entry : list) {
        if (entry.isDir()) {
          assertEquals(subsubdir, entry.getPath());
View Full Code Here

      final FileStatus file = fs.getFileStatus(filePath);
      latestModTime = Math.max(latestModTime, file.getModificationTime());
     
      // enumerate all files and check their modification time stamp.
      if (file.isDir()) {
        FileStatus[] fss = fs.listStatus(filePath);
        files.ensureCapacity(files.size() + fss.length);
       
        for (FileStatus s : fss) {
          if (!s.isDir()) {
            files.add(s);
View Full Code Here

      final FileStatus file = fs.getFileStatus(filePath);
      latestModTime = Math.max(latestModTime, file.getModificationTime());
     
      // enumerate all files and check their modification time stamp.
      if (file.isDir()) {
        FileStatus[] fss = fs.listStatus(filePath);
        files.ensureCapacity(files.size() + fss.length);
       
        for (FileStatus s : fss) {
          if (!s.isDir()) {
            files.add(s);
View Full Code Here

    final FileSystem fs = this.filePath.getFileSystem();
    final FileStatus pathFile = fs.getFileStatus(this.filePath);

    if (pathFile.isDir()) {
      // input is directory. list all contained files
      final FileStatus[] partials = fs.listStatus(this.filePath);
      for (int i = 0; i < partials.length; i++) {
        if (!partials[i].isDir()) {
          files.add(partials[i]);
        }
      }
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.