public class HadoopFileIO extends java.lang.Object implements FileIO, HadoopConfigurable
Constructor and Description |
---|
HadoopFileIO()
Constructor used for dynamic FileIO loading.
|
HadoopFileIO(org.apache.hadoop.conf.Configuration hadoopConf) |
HadoopFileIO(SerializableSupplier<org.apache.hadoop.conf.Configuration> hadoopConf) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
conf() |
void |
deleteFile(java.lang.String path)
Delete the file at the given path.
|
org.apache.hadoop.conf.Configuration |
getConf() |
InputFile |
newInputFile(java.lang.String path)
Get a
InputFile instance to read bytes from the file at the given path. |
OutputFile |
newOutputFile(java.lang.String path)
Get a
OutputFile instance to write bytes to the file at the given path. |
void |
serializeConfWith(java.util.function.Function<org.apache.hadoop.conf.Configuration,SerializableSupplier<org.apache.hadoop.conf.Configuration>> confSerializer)
Take a function that serializes Hadoop configuration into a supplier.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, deleteFile, deleteFile, initialize
public HadoopFileIO()
Hadoop configuration
must be set through setConf(Configuration)
public HadoopFileIO(org.apache.hadoop.conf.Configuration hadoopConf)
public HadoopFileIO(SerializableSupplier<org.apache.hadoop.conf.Configuration> hadoopConf)
public org.apache.hadoop.conf.Configuration conf()
public InputFile newInputFile(java.lang.String path)
FileIO
InputFile
instance to read bytes from the file at the given path.newInputFile
in interface FileIO
public OutputFile newOutputFile(java.lang.String path)
FileIO
OutputFile
instance to write bytes to the file at the given path.newOutputFile
in interface FileIO
public void deleteFile(java.lang.String path)
FileIO
deleteFile
in interface FileIO
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public void serializeConfWith(java.util.function.Function<org.apache.hadoop.conf.Configuration,SerializableSupplier<org.apache.hadoop.conf.Configuration>> confSerializer)
HadoopConfigurable
serializeConfWith
in interface HadoopConfigurable
confSerializer
- A function that takes Hadoop configuration and returns a serializable supplier of it.