use of org.apache.hadoop.fs.AvroFSInput in project samza by apache.
the class AvroFileHdfsReader method open.
@Override
public void open(String pathStr, String singleFileOffset) {
LOG.info(String.format("%s: Open file [%s] with file offset [%s] for read", systemStreamPartition, pathStr, singleFileOffset));
Path path = new Path(pathStr);
try {
AvroFSInput input = new AvroFSInput(FileContext.getFileContext(path.toUri()), path);
fileReader = new DataFileReader<>(input, new GenericDatumReader<>());
seek(singleFileOffset);
} catch (IOException e) {
throw new SamzaException(e);
}
}
Aggregations