T
- target data model classpublic class FileSystemModelInputProvider<T> extends Object implements ModelInputProvider<T>
ModelInputProvider
using FileSystem
.Constructor and Description |
---|
FileSystemModelInputProvider(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.FileSystem fileSystem,
Iterable<org.apache.hadoop.fs.Path> paths,
Class<T> dataModelClass)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
next()
Returns true iff the next temporary file exists,
and then the
ModelInputProvider.open() method returns it. |
ModelInput<T> |
open()
Opens the current temporary file prepared by the
ModelInputProvider.next() method. |
public FileSystemModelInputProvider(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fileSystem, Iterable<org.apache.hadoop.fs.Path> paths, Class<T> dataModelClass) throws IOException
configuration
- the configurationfileSystem
- target file systempaths
- source pathsdataModelClass
- target data model classIOException
- if failed to resolve pathsIllegalArgumentException
- if some parameters were null
public boolean next() throws IOException
ModelInputProvider
ModelInputProvider.open()
method returns it.next
in interface ModelInputProvider<T>
true
if the next data model object exists, otherwise false
IOException
- if failed to prepare the next datapublic ModelInput<T> open() throws IOException
ModelInputProvider
ModelInputProvider.next()
method.
This operation can perform only once for each temporary file.open
in interface ModelInputProvider<T>
IOException
- if failed to open the filepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.