/** Open a new file for data matching a schema with a random sync. */ public DataFileWriter<D> create(Schema schema, File file) throws IOException { return create(schema, new SyncableFileOutputStream(file), null); }
/** Open a new file for data matching a schema with a random sync. */ public DataFileWriter<D> create(Schema schema, File file) throws IOException { SyncableFileOutputStream sfos = new SyncableFileOutputStream(file); try { return create(schema, sfos, null); } catch (final Throwable e) { IOUtils.closeQuietly(sfos); throw e; } }
/** Open a writer appending to an existing file. */ public DataFileWriter<D> appendTo(File file) throws IOException { return appendTo(new SeekableFileInput(file), new SyncableFileOutputStream(file, true)); }
/** Open a writer appending to an existing file. */ public DataFileWriter<D> appendTo(File file) throws IOException { SeekableInput input = null; try { input = new SeekableFileInput(file); OutputStream output = new SyncableFileOutputStream(file, true); return appendTo(input, output); } finally { if (input != null) input.close(); // output does not need to be closed here. It will be closed by invoking close() of this writer. } }
/** Open a new file for data matching a schema with a random sync. */ public DataFileWriter<D> create(Schema schema, File file) throws IOException { return create(schema, new SyncableFileOutputStream(file), null); }
/** Open a writer appending to an existing file. */ public DataFileWriter<D> appendTo(File file) throws IOException { return appendTo(new SeekableFileInput(file), new SyncableFileOutputStream(file, true)); }