public class StorageStrategy extends Object
Modifier and Type | Field and Description |
---|---|
static StorageStrategy |
DEFAULT
For directories: drwxrwxr-x (owner and group have full access, others can read and execute).
|
static StorageStrategy |
TEMPORARY
Primary is used for temporary tables.
|
Constructor and Description |
---|
StorageStrategy(String umask,
boolean deleteOnExit) |
Modifier and Type | Method and Description |
---|---|
void |
applyToFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file)
Applies storage strategy to file:
sets permission and adds to file system delete on exit list if needed.
|
org.apache.hadoop.fs.Path |
createFileAndApply(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file)
Creates passed file on appropriate file system.
|
org.apache.hadoop.fs.Path |
createPathAndApply(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Creates passed path on appropriate file system.
|
org.apache.hadoop.fs.permission.FsPermission |
getFilePermission() |
org.apache.hadoop.fs.permission.FsPermission |
getFolderPermission() |
String |
getUmask() |
boolean |
isDeleteOnExit() |
String |
toString() |
public static final StorageStrategy DEFAULT
public static final StorageStrategy TEMPORARY
public StorageStrategy(String umask, boolean deleteOnExit)
public String getUmask()
public boolean isDeleteOnExit()
public org.apache.hadoop.fs.permission.FsPermission getFolderPermission()
public org.apache.hadoop.fs.permission.FsPermission getFilePermission()
public org.apache.hadoop.fs.Path createPathAndApply(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
fs
- file system where file should be locatedpath
- location pathIOException
- is thrown in case of problems while creating path, setting permission
or adding path to delete on exit listpublic org.apache.hadoop.fs.Path createFileAndApply(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file) throws IOException
fs
- file system where file should be locatedfile
- file pathIOException
- is thrown in case of problems while creating path, setting permission
or adding path to delete on exit listpublic void applyToFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file) throws IOException
fs
- file systemfile
- path to fileIOException
- is thrown in case of problems while setting permission
or adding file to delete on exit listCopyright © 1970 The Apache Software Foundation. All rights reserved.