T
- value typepublic class SequenceFileModelInput<T extends org.apache.hadoop.io.Writable> extends Object implements ModelInput<T>
SequenceFile
into ModelInput
.
The key type of sequence file must be NullWritable
.Constructor and Description |
---|
SequenceFileModelInput(org.apache.hadoop.io.SequenceFile.Reader reader)
Creates a new instance.
|
SequenceFileModelInput(org.apache.hadoop.io.SequenceFile.Reader reader,
Closeable closeable)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
readTo(T model)
Reads contents and write them into the target data model object.
|
public SequenceFileModelInput(org.apache.hadoop.io.SequenceFile.Reader reader)
reader
- target readerIllegalArgumentException
- if some parameters were null
public SequenceFileModelInput(org.apache.hadoop.io.SequenceFile.Reader reader, Closeable closeable)
reader
- target readercloseable
- chained close target (nullable)IllegalArgumentException
- if some parameters were null
public boolean readTo(T model) throws IOException
ModelInput
readTo
in interface ModelInput<T extends org.apache.hadoop.io.Writable>
model
- the target data model objecttrue
if the next data was successfully read, or false
if there is no any moreIOException
- if error occurred while reading the next datapublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.