Package org.apache.flink.core.fs

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


      final FileSystem fs = dir.getFileSystem();

      fs.mkdirs(subsubdir);

      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);
View Full Code Here


      final FileSystem fs = dir.getFileSystem();

      fs.mkdirs(dir);

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

      final FileStatus fileStatus = fs.getFileStatus(file);
      assertNotNull(fileStatus);
View Full Code Here

    // Create test bucket
    fs.mkdirs(bucketPath);

    // Write test file to S3
    final FSDataOutputStream outputStream = fs.create(objectPath, false);
    generateTestData(outputStream, fileSize);
    outputStream.close();

    // Now read the same file back from S3
    final FSDataInputStream inputStream = fs.open(objectPath);
View Full Code Here

          String localPath = targetPath.toString() + distPath.substring(distPath.lastIndexOf("/"));
          copy(content.getPath(), new Path(localPath), executable);
        }
      } else {
        try {
          FSDataOutputStream lfsOutput = tFS.create(targetPath, false);
          FSDataInputStream fsInput = sFS.open(sourcePath);
          IOUtils.copyBytes(fsInput, lfsOutput);
          new File(targetPath.toString()).setExecutable(executable);
        } catch (IOException ioe) {
          LOG.error("could not copy file to local file cache.", ioe);
View Full Code Here

     
    // Suffix the path with the parallel instance index, if needed
    this.actualFilePath = (numTasks > 1 || outputDirectoryMode == OutputDirectoryMode.ALWAYS) ? p.suffix("/" + (taskNumber+1)) : p;

    // create output file
    this.stream = fs.create(this.actualFilePath, writeMode == WriteMode.OVERWRITE);
   
    // at this point, the file creation must have succeeded, or an exception has been thrown
    this.fileCreated = true;
  }
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.