T
- the type of target data modelpublic class HadoopFileFormatAdapter<T> extends HadoopFileFormat<T>
BinaryStreamFormat
into HadoopFileFormat
.Constructor and Description |
---|
HadoopFileFormatAdapter(BinaryStreamFormat<T> streamFormat)
Creates a new instance.
|
HadoopFileFormatAdapter(BinaryStreamFormat<T> streamFormat,
org.apache.hadoop.conf.Configuration configuration)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
ModelInput<T> |
createInput(Class<? extends T> dataType,
org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path path,
long offset,
long fragmentSize,
Counter counter)
Creates a new
ModelInput for the specified properties. |
ModelOutput<T> |
createOutput(Class<? extends T> dataType,
org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path path,
Counter counter)
Creates a new
ModelOutput for the specified properties. |
long |
getMinimumFragmentSize()
Returns the lower limit of fragment size (in bytes).
|
long |
getPreferredFragmentSize()
Returns the preferred fragment size (in bytes).
|
Class<T> |
getSupportedType()
Returns the supported data model type.
|
createInput
public HadoopFileFormatAdapter(BinaryStreamFormat<T> streamFormat)
streamFormat
- adaption targetIllegalArgumentException
- if some parameters were null
public HadoopFileFormatAdapter(BinaryStreamFormat<T> streamFormat, org.apache.hadoop.conf.Configuration configuration)
streamFormat
- adaption targetconfiguration
- initial configurationIllegalArgumentException
- if some parameters were null
public Class<T> getSupportedType()
DataFormat
public long getPreferredFragmentSize() throws IOException, InterruptedException
FragmentableDataFormat
-1
as infiniteIOException
- if failed to compute bytes countInterruptedException
- if interruptedpublic long getMinimumFragmentSize() throws IOException, InterruptedException
FragmentableDataFormat
-1
as infinite (never split into fragments)IOException
- if failed to compute bytes countInterruptedException
- if interruptedpublic ModelInput<T> createInput(Class<? extends T> dataType, org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path path, long offset, long fragmentSize, Counter counter) throws IOException, InterruptedException
HadoopFileFormat
ModelInput
for the specified properties.createInput
in class HadoopFileFormat<T>
dataType
- the target data typefileSystem
- the file system to open the target pathpath
- the path to the target fileoffset
- starting stream offsetfragmentSize
- suggested fragment bytes count, or -1
as infinitecounter
- the current counterIOException
- if failed to create readerInterruptedException
- if interruptedpublic ModelOutput<T> createOutput(Class<? extends T> dataType, org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path path, Counter counter) throws IOException, InterruptedException
HadoopFileFormat
ModelOutput
for the specified properties.createOutput
in class HadoopFileFormat<T>
dataType
- the target data typefileSystem
- the file system to open the target pathpath
- the path to the target filecounter
- the current counterIOException
- if failed to create writerInterruptedException
- if interruptedCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.