use of org.apache.hadoop.io.SequenceFile.Reader in project hadoop by apache.
the class TestSequenceFileAppend method verifyAll4Values.
private void verifyAll4Values(Path file) throws IOException {
Reader reader = new Reader(conf, Reader.file(file));
assertEquals(1L, reader.next((Object) null));
assertEquals("one", reader.getCurrentValue((Object) null));
assertEquals(2L, reader.next((Object) null));
assertEquals("two", reader.getCurrentValue((Object) null));
assertEquals(3L, reader.next((Object) null));
assertEquals("three", reader.getCurrentValue((Object) null));
assertEquals(4L, reader.next((Object) null));
assertEquals("four", reader.getCurrentValue((Object) null));
assertNull(reader.next((Object) null));
reader.close();
}
use of org.apache.hadoop.io.SequenceFile.Reader in project asterixdb by apache.
the class SequenceLookupReader method openFile.
@SuppressWarnings("deprecation")
@Override
protected void openFile() throws IllegalArgumentException, IOException {
reader = new SequenceFile.Reader(fs, new Path(file.getFileName()), conf);
key = (Writable) ReflectionUtils.newInstance(reader.getKeyClass(), conf);
value = (Text) ReflectionUtils.newInstance(reader.getValueClass(), conf);
}
use of org.apache.hadoop.io.SequenceFile.Reader in project incubator-systemml by apache.
the class TfUtils method initOffsetsReader.
private Reader initOffsetsReader(JobConf job) throws IOException {
Path path = new Path(job.get(CSVReblockMR.ROWID_FILE_NAME));
FileSystem fs = IOUtilFunctions.getFileSystem(path, job);
Path[] files = MatrixReader.getSequenceFilePaths(fs, path);
if (files.length != 1)
throw new IOException("Expecting a single file under counters file: " + path.toString());
Reader reader = new SequenceFile.Reader(fs, files[0], job);
return reader;
}
Aggregations