Package org.apache.flink.core.fs

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


    // 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);
    testReceivedData(inputStream, fileSize);
    inputStream.close();
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

      /*
       * check that lfs can create/read/write from/to files properly and read meta information..
       */

      // create files.. one ""natively"", one using lfs
      final FSDataOutputStream lfsoutput1 = lfs.create(pathtotestfile1, false);
      testfile2.createNewFile();

      // does lfs create files? does lfs recognize created files?
      assertTrue(testfile1.exists());
      assertTrue(lfs.exists(pathtotestfile2));

      // test that lfs can write to files properly
      final byte[] testbytes = { 1, 2, 3, 4, 5 };
      lfsoutput1.write(testbytes);
      lfsoutput1.close();

      assertEquals(testfile1.length(), 5l);

      final FileInputStream fisfile1 = new FileInputStream(testfile1);
      byte[] testbytestest = new byte[5];
View Full Code Here

    this.fileCreated = true;
  }

  @Override
  public void close() throws IOException {
    final FSDataOutputStream s = this.stream;
    if (s != null) {
      this.stream = null;
      s.close();
    }
  }
View Full Code Here

TOP

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

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.