Package org.apache.flink.core.fs

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


   
    // TODO The job-submission web interface passes empty args (and thus empty
    // paths) to compute the preview graph. The following is a workaround for
    // this situation and we should fix this.
    if (filePath.isEmpty()) {
      setFilePath(new Path());
      return;
    }
   
    setFilePath(new Path(filePath));
  }
View Full Code Here


  public void configure(Configuration parameters) {
    // get the file path
    String filePath = parameters.getString(FILE_PARAMETER_KEY, null);
    if (filePath != null) {
      try {
        this.filePath = new Path(filePath);
      }
      catch (RuntimeException rex) {
        throw new RuntimeException("Could not create a valid URI from the given file path name: " + rex.getMessage());
      }
    }
View Full Code Here

   
    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

    }
   
    // take the desired number of splits into account
    minNumSplits = Math.max(minNumSplits, this.numSplits);
   
    final Path path = this.filePath;
    final List<FileInputSplit> inputSplits = new ArrayList<FileInputSplit>(minNumSplits);

    // get all the files that are involved in the splits
    List<FileStatus> files = new ArrayList<FileStatus>();
    long totalLength = 0;

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

    if(!acceptFile(pathFile)) {
      throw new IOException("The given file does not pass the file-filter");
    }
View Full Code Here

   * @return The DataSink that writes the DataSet.
   *
   * @see TextOutputFormat
   */
  public DataSink<T> writeAsText(String filePath) {
    return output(new TextOutputFormat<T>(new Path(filePath)));
  }
View Full Code Here

   * @return The DataSink that writes the DataSet.
   *
   * @see TextOutputFormat
   */
  public DataSink<T> writeAsText(String filePath, WriteMode writeMode) {
    TextOutputFormat<T> tof = new TextOutputFormat<T>(new Path(filePath));
    tof.setWriteMode(writeMode);
    return output(tof);
  }
View Full Code Here

   *
   * @see Tuple
   * @see CsvOutputFormat
   */
  public DataSink<T> writeAsCsv(String filePath, WriteMode writeMode) {
    return internalWriteAsCsv(new Path(filePath),CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER, writeMode);
  }
View Full Code Here

   *
   * @see Tuple
   * @see CsvOutputFormat
   */
  public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter) {
    return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, null);
  }
View Full Code Here

   *
   * @see Tuple
   * @see CsvOutputFormat
   */
  public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter, WriteMode writeMode) {
    return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, writeMode);
  }
View Full Code Here

   */
  public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath) {
    Validate.notNull(filePath, "File path must not be null.");
    Validate.notNull(outputFormat, "Output format must not be null.");

    outputFormat.setOutputFilePath(new Path(filePath));
    return output(outputFormat);
  }
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.