Example usage for Java org.apache.hadoop.fs FileSystem fields, constructors, methods, implement or subclass
The text is from its open source code.
String | FS_DEFAULT_NAME_KEY |
String | DEFAULT_FS |
Log | LOG This log is widely used in the org.apache.hadoop.fs code and tests, so must be considered something to only be changed with care. |
int | SHUTDOWN_HOOK_PRIORITY Priority of the FileSystem shutdown hook: . |
Set | deleteOnExit A cache of files that should be deleted when the FileSystem is closed or the JVM is exited. |
void | access(Path path, FsAction mode) Checks if the user can access a path. |
Token>[] | addDelegationTokens(final String renewer, Credentials credentials) Given a renewer, add delegation tokens for issuer and it's child issuers to the Credentials object if it is not already present. |
FSDataOutputStream | append(Path f) Append to an existing file (optional operation). |
FSDataOutputStream | append(Path f, int bufferSize) Append to an existing file (optional operation). |
FSDataOutputStreamBuilder | appendFile(Path path) Create a Builder to append a file. |
boolean | areSymlinksEnabled() |
void | clearStatistics() Reset all statistics for all file systems. |
void | close() Close this FileSystem instance. |
void | closeAll() Close all cached FileSystem instances. |
void | closeAllForUGI(UserGroupInformation ugi) Close all cached FileSystem instances for a given UGI. |
void | completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) Called when we're all done writing to the target. |
void | concat(final Path trg, final Path[] psrcs) Concat existing files together. |
void | copyFromLocalFile(Path src, Path dst) The src file is on the local disk. |
void | copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst) The src files are on the local disk. |
void | copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst) The src file is on the local disk. |
void | copyFromLocalFile(boolean delSrc, Path src, Path dst) The src file is on the local disk. |
void | copyToLocalFile(Path src, Path dst) Copy it a file from the remote filesystem to the local one. |
void | copyToLocalFile(boolean delSrc, Path src, Path dst) Copy it a file from a remote filesystem to the local one. |
void | copyToLocalFile(boolean delSrc, Path src, Path dst, boolean useRawLocalFileSystem) The src file is under this filesystem, and the dst is on the local disk. |
FSDataOutputStream | create(Path f, boolean overwrite, int bufferSize, short replication, long blockSize) Create an FSDataOutputStream at the indicated Path. |
FSDataOutputStream | create(Path f) Create an FSDataOutputStream at the indicated Path. |
FSDataOutputStream | create(Path f, boolean overwrite) Create an FSDataOutputStream at the indicated Path. |
FSDataOutputStream | create(Path f, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(Path f, short replication) Create an FSDataOutputStream at the indicated Path. |
FSDataOutputStream | create(Path f, boolean overwrite, int bufferSize, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(FileSystem fs, Path file, FsPermission permission) Create a file with the provided permission. |
FSDataOutputStream | create(Path f, short replication, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(Path f, boolean overwrite, int bufferSize) Create an FSDataOutputStream at the indicated Path. |
FSDataOutputStream | create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(Path f, FsPermission permission, EnumSet Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(Path f, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Create an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | create(Path f, FsPermission permission, EnumSet Create an FSDataOutputStream at the indicated Path with a custom checksum option. |
FSDataOutputStreamBuilder | createFile(Path path) Create a new FSDataOutputStreamBuilder for the file with path. |
boolean | createNewFile(Path f) Creates the given Path as a brand-new zero-length file. |
FSDataOutputStream | createNonRecursive(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) Opens an FSDataOutputStream at the indicated Path with write-progress reporting. |
FSDataOutputStream | createNonRecursive(Path f, FsPermission permission, EnumSet Opens an FSDataOutputStream at the indicated Path with write-progress reporting. |
Path | createSnapshot(Path path, String snapshotName) Create a snapshot. |
void | createSymlink(final Path target, final Path link, final boolean createParent) See FileContext#createSymlink(Path,Path,boolean) . |
boolean | delete(Path f, boolean recursive) Delete a file. |
boolean | delete(Path f) Delete a file/directory. |
void | enableSymlinks() |
boolean | exists(Path f) Check if a path exists. |
FileSystem | get(Configuration conf) Returns the configured FileSystem implementation. |
FileSystem | get(URI uri, Configuration conf) Get a FileSystem for this URI's scheme and authority. |
AclStatus | getAclStatus(Path path) Gets the ACL of a file or directory. |
List | getAllStatistics() Return the FileSystem classes that have Statistics. |
String | getCanonicalServiceName() Get a canonical service name for this FileSystem. |
FileSystem[] | getChildFileSystems() Get all the immediate child FileSystems embedded in this FileSystem. |
Configuration | getConf() |
ContentSummary | getContentSummary(Path f) Return the ContentSummary of a given Path . |
long | getDefaultBlockSize(Path f) Return the number of bytes that large input files should be optimally be split into to minimize I/O time. |
long | getDefaultBlockSize() Return the number of bytes that large input files should be optimally be split into to minimize I/O time. |
short | getDefaultReplication(Path path) Get the default replication for a path. |
short | getDefaultReplication() Get the default replication. |
URI | getDefaultUri(Configuration conf) Get the default FileSystem URI from a configuration. |
Token> | getDelegationToken(String renewer) Get a new delegation token for this FileSystem. |
BlockLocation[] | getFileBlockLocations(FileStatus file, long start, long len) Return an array containing hostnames, offset and size of portions of the given file. |
BlockLocation[] | getFileBlockLocations(Path p, long start, long len) Return an array containing hostnames, offset and size of portions of the given file. |
FileChecksum | getFileChecksum(Path f) Get the checksum of a file, if the FS supports checksums. |
FileStatus | getFileLinkStatus(final Path f) See FileContext#getFileLinkStatus(Path) . |
FileStatus | getFileStatus(Path f) Return a file status object that represents the path. |
Class extends FileSystem> | getFileSystemClass(String scheme, Configuration conf) Get the FileSystem implementation class of a filesystem. |
Path | getHomeDirectory() Return the current user's home directory in this FileSystem. |
long | getLength(Path f) The number of bytes in a file. |
Path | getLinkTarget(Path f) See FileContext#getLinkTarget(Path) . |
LocalFileSystem | getLocal(Configuration conf) Get the local FileSystem. |
String | getName() |
String | getScheme() Return the protocol scheme for this FileSystem. |
FsServerDefaults | getServerDefaults(Path p) Return a set of server default configuration values. |
Statistics | getStatistics(final String scheme, Class extends FileSystem> cls) Get the statistics for a particular file system. |
FsStatus | getStatus() Returns a status object describing the use and capacity of the filesystem. |
FsStatus | getStatus(Path p) Returns a status object describing the use and capacity of the filesystem. |
URI | getUri() Returns a URI which identifies this FileSystem. |
long | getUsed() Return the total size of all files in the filesystem. |
Path | getWorkingDirectory() Get the current working directory for the given FileSystem |
byte[] | getXAttr(Path path, String name) Get an xattr name and value for a file or directory. |
Map | getXAttrs(Path path) Get all of the xattr name/value pairs for a file or directory. |
Map | getXAttrs(Path path, List Get all of the xattrs name/value pairs for a file or directory. |
FileStatus[] | globStatus(Path pathPattern) Return all the files that match filePattern and are not checksum files. |
FileStatus[] | globStatus(Path pathPattern, PathFilter filter) Return an array of FileStatus objects whose path names match pathPattern and is accepted by the user-supplied path filter. |
void | initialize(URI name, Configuration conf) Initialize a FileSystem. |
boolean | isDirectory(Path f) True iff the named path is a directory. |
boolean | isFile(Path f) True iff the named path is a regular file. |
RemoteIterator | listFiles(final Path f, final boolean recursive) List the statuses and block locations of the files in the given path. |
RemoteIterator | listLocatedStatus(final Path f) List the statuses of the files/directories in the given path if the path is a directory. |
FileStatus[] | listStatus(Path f, PathFilter filter) Filter files/directories in the given path using the user-supplied path filter. |
FileStatus[] | listStatus(Path[] files, PathFilter filter) Filter files/directories in the given list of paths using user-supplied path filter. |
FileStatus[] | listStatus(Path f) List the statuses of the files/directories in the given path if the path is a directory. |
FileStatus[] | listStatus(Path[] files) Filter files/directories in the given list of paths using default path filter. |
List | listXAttrs(Path path) Get all of the xattr names for a file or directory. |
Path | makeQualified(Path path) Qualify a path to one which uses this FileSystem and, if relative, made absolute. |
boolean | mkdirs(Path f) Call #mkdirs(Path,FsPermission) with default permission. |
boolean | mkdirs(FileSystem fs, Path dir, FsPermission permission) Create a directory with the provided permission. |
boolean | mkdirs(Path f, FsPermission permission) Make the given file and all non-existent parents into directories. |
void | modifyAclEntries(Path path, List Modifies ACL entries of files and directories. |
void | moveFromLocalFile(Path[] srcs, Path dst) The src files is on the local disk. |
void | moveFromLocalFile(Path src, Path dst) The src file is on the local disk. |
FileSystem | newInstance(URI uri, Configuration config) Returns the FileSystem for this URI's scheme and authority. |
FileSystem | newInstance(Configuration conf) Returns a unique configured FileSystem implementation for the default filesystem of the supplied configuration. |
FileSystem | newInstance(final URI uri, final Configuration conf, final String user) Returns the FileSystem for this URI's scheme and authority and the given user. |
LocalFileSystem | newInstanceLocal(Configuration conf) Get a unique local FileSystem object. |
FSDataInputStream | open(Path f) Opens an FSDataInputStream at the indicated Path. |
FSDataInputStream | open(PathHandle fd) Open an FSDataInputStream matching the PathHandle instance. |
FSDataInputStream | open(Path f, int bufferSize) Opens an FSDataInputStream at the indicated Path. |
FSDataInputStream | open(PathHandle fd, int bufferSize) Open an FSDataInputStream matching the PathHandle instance. |
void | removeAcl(Path path) Removes all but the base ACL entries of files and directories. |
void | removeAclEntries(Path path, List Removes ACL entries from files and directories. |
void | removeDefaultAcl(Path path) Removes all default ACL entries from files and directories. |
void | removeXAttr(Path path, String name) Remove an xattr of a file or directory. |
boolean | rename(Path src, Path dst) Renames Path src to Path dst. |
Path | resolvePath(final Path p) Return the fully-qualified path of path, resolving the path through any symlinks or mount point. |
void | setAcl(Path path, List Fully replaces ACL of files and directories, discarding all existing entries. |
void | setConf(Configuration conf) |
void | setDefaultUri(Configuration conf, URI uri) Set the default FileSystem URI in a configuration. |
void | setDefaultUri(Configuration conf, String uri) Set the default FileSystem URI in a configuration. |
void | setOwner(Path p, String username, String groupname) Set owner of a path (i.e. |
void | setPermission(Path p, FsPermission permission) Set permission of a path. |
boolean | setReplication(Path src, short replication) Set the replication for an existing file. |
void | setTimes(Path p, long mtime, long atime) Set access time of a file. |
void | setVerifyChecksum(boolean verifyChecksum) Set the verify checksum flag. |
void | setWorkingDirectory(Path new_dir) Set the current working directory for the given FileSystem. |
void | setWriteChecksum(boolean writeChecksum) Set the write checksum flag. |
void | setXAttr(Path path, String name, byte[] value, EnumSet Set an xattr of a file or directory. |
Path | startLocalOutput(Path fsOutputFile, Path tmpLocalFile) Returns a local file that the user can write output to. |
boolean | truncate(Path f, long newLength) Truncate the file in the indicated path to the indicated size. |