public class HadoopInputFile extends java.lang.Object implements InputFile, NativelyEncryptedFile
InputFile
implementation using the Hadoop FileSystem
API.
This class is based on Parquet's HadoopInputFile.
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
NO_LOCATION_PREFERENCE |
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Checks whether the file exists.
|
static HadoopInputFile |
fromLocation(java.lang.CharSequence location,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromLocation(java.lang.CharSequence location,
org.apache.hadoop.fs.FileSystem fs) |
static HadoopInputFile |
fromLocation(java.lang.CharSequence location,
long length,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromLocation(java.lang.CharSequence location,
long length,
org.apache.hadoop.fs.FileSystem fs) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileSystem fs) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
long length,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
long length,
org.apache.hadoop.fs.FileSystem fs) |
static HadoopInputFile |
fromPath(org.apache.hadoop.fs.Path path,
long length,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromStatus(org.apache.hadoop.fs.FileStatus stat,
org.apache.hadoop.conf.Configuration conf) |
static HadoopInputFile |
fromStatus(org.apache.hadoop.fs.FileStatus stat,
org.apache.hadoop.fs.FileSystem fs) |
static HadoopInputFile |
fromStatus(org.apache.hadoop.fs.FileStatus stat,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf) |
java.lang.String[] |
getBlockLocations(long start,
long end) |
org.apache.hadoop.conf.Configuration |
getConf() |
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
long |
getLength()
Returns the total length of the file, in bytes
|
org.apache.hadoop.fs.Path |
getPath() |
org.apache.hadoop.fs.FileStatus |
getStat() |
java.lang.String |
location()
The fully-qualified location of the input file as a String.
|
NativeFileCryptoParameters |
nativeCryptoParameters() |
SeekableInputStream |
newStream()
Opens a new
SeekableInputStream for the underlying data file |
void |
setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters) |
java.lang.String |
toString() |
public static HadoopInputFile fromLocation(java.lang.CharSequence location, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromLocation(java.lang.CharSequence location, long length, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromLocation(java.lang.CharSequence location, org.apache.hadoop.fs.FileSystem fs)
public static HadoopInputFile fromLocation(java.lang.CharSequence location, long length, org.apache.hadoop.fs.FileSystem fs)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, long length, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, long length, org.apache.hadoop.fs.FileSystem fs)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromPath(org.apache.hadoop.fs.Path path, long length, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromStatus(org.apache.hadoop.fs.FileStatus stat, org.apache.hadoop.conf.Configuration conf)
public static HadoopInputFile fromStatus(org.apache.hadoop.fs.FileStatus stat, org.apache.hadoop.fs.FileSystem fs)
public static HadoopInputFile fromStatus(org.apache.hadoop.fs.FileStatus stat, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
public long getLength()
InputFile
public SeekableInputStream newStream()
InputFile
SeekableInputStream
for the underlying data filepublic org.apache.hadoop.conf.Configuration getConf()
public org.apache.hadoop.fs.FileSystem getFileSystem()
public org.apache.hadoop.fs.FileStatus getStat()
public org.apache.hadoop.fs.Path getPath()
public java.lang.String[] getBlockLocations(long start, long end)
public java.lang.String location()
InputFile
public boolean exists()
InputFile
public NativeFileCryptoParameters nativeCryptoParameters()
nativeCryptoParameters
in interface NativelyEncryptedFile
public void setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters)
setNativeCryptoParameters
in interface NativelyEncryptedFile
public java.lang.String toString()
toString
in class java.lang.Object