|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cloudera.hoop.fs.FSUtils
public class FSUtils
File system utilities used by Hoop classes.
Field Summary | |
---|---|
static String |
DEFAULT_PERMISSION
Constant for the default permission string ('default'). |
Constructor Summary | |
---|---|
FSUtils()
|
Method Summary | |
---|---|
static org.apache.hadoop.fs.Path |
convertPathToHoop(org.apache.hadoop.fs.Path path,
String hoopBaseUrl)
Replaces the SCHEME://HOST:PORT of a Hadoop
Path with the specified base URL. |
static org.json.simple.JSONArray |
fileStatusToJSON(org.apache.hadoop.fs.FileStatus[] status,
String hoopBaseUrl)
Converts a Hadoop FileStatus array into a JSON array
object. |
static Map |
fileStatusToJSON(org.apache.hadoop.fs.FileStatus status,
String hoopBaseUrl)
Converts a Hadoop FileStatus object into a JSON array
object. |
static org.apache.hadoop.fs.permission.FsPermission |
getPermission(String str)
Converts a Unix permission symbolic representation (i.e. |
static org.json.simple.JSONObject |
toJSON(String name,
Object value)
Converts an object into a Json Map with with one key-value entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_PERMISSION
Constructor Detail |
---|
public FSUtils()
Method Detail |
---|
public static org.apache.hadoop.fs.permission.FsPermission getPermission(String str)
str
- Unix permission symbolic representation.
FsPermission.getDefault()
.public static org.apache.hadoop.fs.Path convertPathToHoop(org.apache.hadoop.fs.Path path, String hoopBaseUrl)
SCHEME://HOST:PORT
of a Hadoop
Path
with the specified base URL.
path
- Hadoop path to replace the
SCHEME://HOST:PORT
.hoopBaseUrl
- base URL to replace it with.
public static Map fileStatusToJSON(org.apache.hadoop.fs.FileStatus status, String hoopBaseUrl)
FileStatus
object into a JSON array
object. It replaces the SCHEME://HOST:PORT
of the path
with the specified URL.
status
- Hadoop file status.hoopBaseUrl
- base URL to replace the
SCHEME://HOST:PORT
in the file status.
public static org.json.simple.JSONArray fileStatusToJSON(org.apache.hadoop.fs.FileStatus[] status, String hoopBaseUrl)
FileStatus
array into a JSON array
object. It replaces the SCHEME://HOST:PORT
of the path
with the specified URL.
status
- Hadoop file status array.hoopBaseUrl
- base URL to replace the
SCHEME://HOST:PORT
in the file status.
public static org.json.simple.JSONObject toJSON(String name, Object value)
JsonAware
instance.
name
- name for the key of the entry.value
- for the value of the entry.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |