/** * 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 configureFileFormat(FileDataSinkBase<?> target) { return new ConfigBuilder(target.getParameters()); }
/** * Checks if FileDataSink is correctly connected. In case that the * contract is incorrectly connected a RuntimeException is thrown. * * @param fileSink * FileDataSink that is checked. */ private void checkFileDataSink(FileDataSinkBase<?> fileSink) { String path = fileSink.getFilePath(); if (path == null) { throw new InvalidProgramException("File path of FileDataSink is null."); } if (path.length() == 0) { throw new InvalidProgramException("File path of FileDataSink is empty string."); } try { Path p = new Path(path); String scheme = p.toUri().getScheme(); if (scheme == null) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink has no file system scheme (like 'file:// or hdfs://')."); } } catch (Exception e) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink is an invalid path: " + e.getMessage()); } checkDataSink(fileSink); }
/** * Checks if FileDataSink is correctly connected. In case that the * contract is incorrectly connected a RuntimeException is thrown. * * @param fileSink * FileDataSink that is checked. */ private void checkFileDataSink(FileDataSinkBase<?> fileSink) { String path = fileSink.getFilePath(); if (path == null) { throw new InvalidProgramException("File path of FileDataSink is null."); } if (path.length() == 0) { throw new InvalidProgramException("File path of FileDataSink is empty string."); } try { Path p = new Path(path); String scheme = p.toUri().getScheme(); if (scheme == null) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink has no file system scheme (like 'file:// or hdfs://')."); } } catch (Exception e) { throw new InvalidProgramException("File path \"" + path + "\" of FileDataSink is an invalid path: " + e.getMessage()); } checkDataSink(fileSink); }
/** * 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 configureFileFormat(FileDataSinkBase<?> target) { return new ConfigBuilder(target.getParameters()); }