org.apache.pig.piggybank.storage.allloader
Class LoadFuncHelper
java.lang.Object
org.apache.pig.piggybank.storage.allloader.LoadFuncHelper
public class LoadFuncHelper
- extends Object
Contains the logic for finding a LoadFunc based on the definition of:
- file.extension.loaders
- file.format.loaders
Constructor Summary |
LoadFuncHelper(org.apache.hadoop.conf.Configuration conf)
|
Method Summary |
org.apache.hadoop.fs.Path |
determineFirstFile(String location)
If location is a directory the first file found is returned |
FuncSpec |
determineFunction(String location)
If location is a directory the first file found in the directory is used.
The file extension of the file will be searched against the
file.extension.loaders mappings. |
FuncSpec |
determineFunction(String location,
org.apache.hadoop.fs.Path path)
The file extension of the file will be searched against the
file.extension.loaders mappings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FILE_EXTENSION_LOADERS
public static final String FILE_EXTENSION_LOADERS
- See Also:
- Constant Field Values
LoadFuncHelper
public LoadFuncHelper(org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
determineFirstFile
public org.apache.hadoop.fs.Path determineFirstFile(String location)
throws IOException
- If location is a directory the first file found is returned
- Parameters:
location
-
- Returns:
-
- Throws:
IOException
- if no file is found a FrontendException is thrown
determineFunction
public FuncSpec determineFunction(String location)
throws IOException
- If location is a directory the first file found in the directory is used.
The file extension of the file will be searched against the
file.extension.loaders mappings. If none found null is returned.
- Parameters:
location
-
- Returns:
-
- Throws:
IOException
determineFunction
public FuncSpec determineFunction(String location,
org.apache.hadoop.fs.Path path)
throws IOException
- The file extension of the file will be searched against the
file.extension.loaders mappings. If none found null is returned.
- Parameters:
path
- location
-
- Returns:
-
- Throws:
IOException
Copyright © 2007-2012 The Apache Software Foundation