/** * Creates a configuration builder that can be used to set the input format's parameters to the config in a fluent * fashion. * * @return A config builder for setting parameters. */ public static ConfigBuilder configureDelimitedFormat(FileDataSourceBase<?> target) { return new ConfigBuilder(target.getParameters()); }
/** * Checks if FileDataSource is correctly connected. In case that the * contract is incorrectly connected a RuntimeException is thrown. * * @param fileSource * FileDataSource that is checked. */ private void checkFileDataSource(FileDataSourceBase<?> fileSource) { String path = fileSource.getFilePath(); if (path == null) { throw new InvalidProgramException("File path of FileDataSource is null."); } if (path.length() == 0) { throw new InvalidProgramException("File path of FileDataSource is empty string."); } try { Path p = new Path(path); String scheme = p.toUri().getScheme(); if (scheme == null) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSource has no file system scheme (like 'file:// or hdfs://')."); } } catch (Exception e) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSource is an invalid path: " + e.getMessage()); } }
/** * Checks if FileDataSource is correctly connected. In case that the * contract is incorrectly connected a RuntimeException is thrown. * * @param fileSource * FileDataSource that is checked. */ private void checkFileDataSource(FileDataSourceBase<?> fileSource) { String path = fileSource.getFilePath(); if (path == null) { throw new InvalidProgramException("File path of FileDataSource is null."); } if (path.length() == 0) { throw new InvalidProgramException("File path of FileDataSource is empty string."); } try { Path p = new Path(path); String scheme = p.toUri().getScheme(); if (scheme == null) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSource has no file system scheme (like 'file:// or hdfs://')."); } } catch (Exception e) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSource is an invalid path: " + e.getMessage()); } }
/** * Creates a configuration builder that can be used to set the input format's parameters to the config in a fluent * fashion. * * @return A config builder for setting parameters. */ public static ConfigBuilder configureDelimitedFormat(FileDataSourceBase<?> target) { return new ConfigBuilder(target.getParameters()); }