public class ObjectsFile<T> extends Object implements SimpleFileReader<T>
T
s, provides read and write.Modifier and Type | Field and Description |
---|---|
protected String |
compression |
protected FileIO |
fileIO |
protected PathFactory |
pathFactory |
protected FormatReaderFactory |
readerFactory |
protected ObjectSerializer<T> |
serializer |
protected FormatWriterFactory |
writerFactory |
Constructor and Description |
---|
ObjectsFile(FileIO fileIO,
ObjectSerializer<T> serializer,
RowType formatType,
FormatReaderFactory readerFactory,
FormatWriterFactory writerFactory,
String compression,
PathFactory pathFactory,
SegmentsCache<Path> cache) |
Modifier and Type | Method and Description |
---|---|
void |
delete(String fileName) |
boolean |
exists(String fileName) |
FileIO |
fileIO() |
long |
fileSize(String fileName) |
List<T> |
read(String fileName) |
List<T> |
read(String fileName,
Long fileSize) |
List<T> |
read(String fileName,
Long fileSize,
Filter<InternalRow> loadFilter,
Filter<InternalRow> readFilter) |
static <V> List<V> |
readFromIterator(CloseableIterator<InternalRow> inputIterator,
ObjectSerializer<V> serializer,
Filter<InternalRow> readFilter) |
List<T> |
readWithIOException(String fileName) |
List<T> |
readWithIOException(String fileName,
Long fileSize) |
String |
writeWithoutRolling(Collection<T> records) |
String |
writeWithoutRolling(Iterator<T> records) |
protected final FileIO fileIO
protected final ObjectSerializer<T> serializer
protected final FormatReaderFactory readerFactory
protected final FormatWriterFactory writerFactory
protected final String compression
protected final PathFactory pathFactory
public ObjectsFile(FileIO fileIO, ObjectSerializer<T> serializer, RowType formatType, FormatReaderFactory readerFactory, FormatWriterFactory writerFactory, String compression, PathFactory pathFactory, @Nullable SegmentsCache<Path> cache)
public FileIO fileIO()
public long fileSize(String fileName)
public List<T> readWithIOException(String fileName) throws IOException
IOException
public List<T> readWithIOException(String fileName, @Nullable Long fileSize) throws IOException
IOException
public boolean exists(String fileName)
public List<T> read(String fileName, @Nullable Long fileSize, Filter<InternalRow> loadFilter, Filter<InternalRow> readFilter)
public String writeWithoutRolling(Collection<T> records)
public void delete(String fileName)
public static <V> List<V> readFromIterator(CloseableIterator<InternalRow> inputIterator, ObjectSerializer<V> serializer, Filter<InternalRow> readFilter)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.