@InterfaceAudience.Public @InterfaceStability.Evolving public class HdfsAdmin extends Object
DFSAdmin
, which
is a class that provides the functionality for the CLI `hdfs dfsadmin ...'
commands.Constructor and Description |
---|
HdfsAdmin(URI uri,
Configuration conf)
Create a new HdfsAdmin client.
|
Modifier and Type | Method and Description |
---|---|
void |
allowSnapshot(Path path)
Allow snapshot on a directory.
|
void |
clearQuota(Path src)
Clear the namespace quota (count of files, directories and sym links) for a
directory.
|
void |
clearSpaceQuota(Path src)
Clear the disk space quota (size of files) for a directory.
|
void |
disallowSnapshot(Path path)
Disallow snapshot on a directory.
|
void |
setQuota(Path src,
long quota)
Set the namespace quota (count of files, directories, and sym links) for a
directory.
|
void |
setSpaceQuota(Path src,
long spaceQuota)
Set the disk space quota (size of files) for a directory.
|
public HdfsAdmin(URI uri, Configuration conf) throws IOException
uri
- the unique URI of the HDFS file system to administerconf
- configurationIOException
- in the event the file system could not be createdpublic void setQuota(Path src, long quota) throws IOException
src
- the path to set the quota forquota
- the value to set for the quotaIOException
- in the event of errorpublic void clearQuota(Path src) throws IOException
src
- the path to clear the quota ofIOException
- in the event of errorpublic void setSpaceQuota(Path src, long spaceQuota) throws IOException
src
- the path to set the space quota ofspaceQuota
- the value to set for the space quotaIOException
- in the event of errorpublic void clearSpaceQuota(Path src) throws IOException
src
- the path to clear the space quota ofIOException
- in the event of errorpublic void allowSnapshot(Path path) throws IOException
path
- The path of the directory where snapshots will be taken.IOException
public void disallowSnapshot(Path path) throws IOException
path
- The path of the snapshottable directory.IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.