@Override public void close() throws IOException { this.closed = true; writer.close(); }
public ClosingIterable(Iterable<T> iterable, Iterable<Closeable> closeables) { this.iterable = iterable; for (Closeable closeable : closeables) { addCloseable(closeable); } }
@Override public void write(InternalRow record) { appender.add(record); }
@Override public void addAll(Iterator<ManifestFile> values) { writer.addAll(values); }
GenericManifestFile(InputFile file, int specId) { this.avroSchema = AVRO_SCHEMA; this.file = file; this.manifestPath = file.location(); this.length = null; // lazily loaded from file this.specId = specId; this.snapshotId = null; this.addedFilesCount = null; this.existingFilesCount = null; this.deletedFilesCount = null; this.partitions = null; this.fromProjectionPos = null; }
public Long lazyLength() { if (length == null) { if (file != null) { // this was created from an input file and length is lazily loaded this.length = file.getLength(); } else { // this was loaded from a file without projecting length, throw an exception return null; } } return length; }
@Override public void seek(long newPos) throws IOException { delegate.seek(newPos); } }
@Override public Metrics metrics() { return writer.metrics(); }
@Override public long getPos() throws IOException { return delegate.getPos(); } }
@Override public boolean markSupported() { return stream.markSupported(); } }
@Override public int read() throws IOException { return stream.read(); }
@Override public int available() throws IOException { return stream.available(); }
@Override public synchronized void reset() throws IOException { stream.reset(); }
@Override public synchronized void mark(int readlimit) { stream.mark(readlimit); }
static <E> CloseableIterable<E> combine(Iterable<E> iterable, Iterable<Closeable> closeables) { return new CloseableGroup.ClosingIterable<>(iterable, closeables); }
@Override public void close() throws IOException { writer.close(); }
@Override public long getLength() throws IOException { return file.getLength(); }
@Override public void seek(long newPos) throws IOException { stream.seek(newPos); }