|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.io.FileLocalizer
public class FileLocalizer
Nested Class Summary | |
---|---|
static class |
FileLocalizer.DataStorageInputStreamIterator
|
static class |
FileLocalizer.FetchFileRet
|
Field Summary | |
---|---|
static String |
LOCAL_PREFIX
|
static int |
STYLE_UNIX
|
static int |
STYLE_WINDOWS
|
Constructor Summary | |
---|---|
FileLocalizer()
|
Method Summary | |
---|---|
static OutputStream |
create(String fileSpec,
boolean append,
PigContext pigContext)
|
static OutputStream |
create(String fileSpec,
PigContext pigContext)
|
static boolean |
delete(String fileSpec,
PigContext pigContext)
|
static void |
deleteTempFiles()
|
static FileLocalizer.FetchFileRet |
fetchFile(Properties properties,
String filePath)
Ensures that the passed path is on the local file system, fetching it to the java.io.tmpdir if necessary. |
static boolean |
fileExists(String filename,
DataStorage store)
Deprecated. Use fileExists(String, PigContext) instead |
static boolean |
fileExists(String filename,
PigContext context)
|
static String |
fullPath(String fileName,
DataStorage storage)
Deprecated. Use fullPath(String, PigContext) instead |
static String |
fullPath(String filename,
PigContext pigContext)
|
static Random |
getR()
|
static long |
getSize(String fileName)
|
static long |
getSize(String fileName,
Properties properties)
|
static ElementDescriptor |
getTemporaryPath(ElementDescriptor relative,
PigContext pigContext)
Deprecated. Use getTemporaryPath(PigContext) instead |
static org.apache.hadoop.fs.Path |
getTemporaryPath(PigContext pigContext)
|
static String |
hadoopify(String filename,
PigContext pigContext)
|
static boolean |
isDirectory(String filename,
DataStorage store)
Deprecated. Use isDirectory(String, PigContext) instead. |
static boolean |
isDirectory(String filename,
PigContext context)
|
static boolean |
isFile(String filename,
DataStorage store)
Deprecated. Use isFile(String, PigContext) instead |
static boolean |
isFile(String filename,
PigContext context)
|
static InputStream |
open(String fileName,
ExecType execType,
DataStorage storage)
Deprecated. Use open(String, PigContext) instead |
static SeekableInputStream |
open(String fileSpec,
long offset,
PigContext pigContext)
|
static InputStream |
open(String fileSpec,
PigContext pigContext)
|
static InputStream |
openDFSFile(String fileName)
This function is meant to be used if the mappers/reducers want to access any HDFS file |
static InputStream |
openDFSFile(String fileName,
Properties properties)
|
static String |
parseCygPath(String path,
int style)
Convert path from Windows convention to Unix convention. |
static void |
setInitialized(boolean initialized)
This method is only used by test code to reset state. |
static void |
setR(Random r)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOCAL_PREFIX
public static final int STYLE_UNIX
public static final int STYLE_WINDOWS
Constructor Detail |
---|
public FileLocalizer()
Method Detail |
---|
public static InputStream openDFSFile(String fileName) throws IOException
fileName
-
IOException
public static InputStream openDFSFile(String fileName, Properties properties) throws IOException
IOException
public static long getSize(String fileName) throws IOException
IOException
public static long getSize(String fileName, Properties properties) throws IOException
IOException
@Deprecated public static InputStream open(String fileName, ExecType execType, DataStorage storage) throws IOException
open(String, PigContext)
instead
fileName
- The filename to openexecType
- execType indicating whether executing in local mode or MapReduce mode (Hadoop)storage
- The DataStorage object used to open the fileSpec
IOException
@Deprecated public static String fullPath(String fileName, DataStorage storage)
fullPath(String, PigContext)
instead
public static InputStream open(String fileSpec, PigContext pigContext) throws IOException
IOException
public static SeekableInputStream open(String fileSpec, long offset, PigContext pigContext) throws IOException
fileSpec
- offset
- pigContext
-
IOException
- This is an overloaded version of open where there is a need to seek in stream. Currently seek is supported
only in file, not in directory or glob.public static OutputStream create(String fileSpec, PigContext pigContext) throws IOException
IOException
public static OutputStream create(String fileSpec, boolean append, PigContext pigContext) throws IOException
IOException
public static boolean delete(String fileSpec, PigContext pigContext) throws IOException
IOException
public static void setInitialized(boolean initialized)
initialized
- public static void deleteTempFiles()
@Deprecated public static ElementDescriptor getTemporaryPath(ElementDescriptor relative, PigContext pigContext) throws IOException
getTemporaryPath(PigContext)
instead
IOException
public static org.apache.hadoop.fs.Path getTemporaryPath(PigContext pigContext) throws IOException
IOException
public static String hadoopify(String filename, PigContext pigContext) throws IOException
IOException
public static String fullPath(String filename, PigContext pigContext) throws IOException
IOException
public static boolean fileExists(String filename, PigContext context) throws IOException
IOException
@Deprecated public static boolean fileExists(String filename, DataStorage store) throws IOException
fileExists(String, PigContext)
instead
IOException
public static boolean isFile(String filename, PigContext context) throws IOException
IOException
@Deprecated public static boolean isFile(String filename, DataStorage store) throws IOException
isFile(String, PigContext)
instead
IOException
public static boolean isDirectory(String filename, PigContext context) throws IOException
IOException
@Deprecated public static boolean isDirectory(String filename, DataStorage store) throws IOException
isDirectory(String, PigContext)
instead.
IOException
public static Random getR()
public static void setR(Random r)
public static String parseCygPath(String path, int style)
path
- path in Windows convention
public static FileLocalizer.FetchFileRet fetchFile(Properties properties, String filePath) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |