@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,
org.apache.hadoop.conf.Configuration conf)
Create a new HdfsAdmin client.
|
Modifier and Type | Method and Description |
---|---|
long |
addCacheDirective(CacheDirectiveInfo info,
EnumSet<CacheFlag> flags)
Add a new CacheDirectiveInfo.
|
void |
addCachePool(CachePoolInfo info)
Add a cache pool.
|
void |
allowSnapshot(org.apache.hadoop.fs.Path path)
Allow snapshot on a directory.
|
void |
clearQuota(org.apache.hadoop.fs.Path src)
Clear the namespace quota (count of files, directories and sym links) for a
directory.
|
void |
clearSpaceQuota(org.apache.hadoop.fs.Path src)
Clear the disk space quota (size of files) for a directory.
|
void |
disallowSnapshot(org.apache.hadoop.fs.Path path)
Disallow snapshot on a directory.
|
org.apache.hadoop.fs.RemoteIterator<CacheDirectiveEntry> |
listCacheDirectives(CacheDirectiveInfo filter)
List cache directives.
|
org.apache.hadoop.fs.RemoteIterator<CachePoolEntry> |
listCachePools()
List all cache pools.
|
void |
modifyCacheDirective(CacheDirectiveInfo info,
EnumSet<CacheFlag> flags)
Modify a CacheDirective.
|
void |
modifyCachePool(CachePoolInfo info)
Modify an existing cache pool.
|
void |
removeCacheDirective(long id)
Remove a CacheDirective.
|
void |
removeCachePool(String poolName)
Remove a cache pool.
|
void |
setQuota(org.apache.hadoop.fs.Path src,
long quota)
Set the namespace quota (count of files, directories, and sym links) for a
directory.
|
void |
setSpaceQuota(org.apache.hadoop.fs.Path src,
long spaceQuota)
Set the disk space quota (size of files) for a directory.
|
public HdfsAdmin(URI uri, org.apache.hadoop.conf.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(org.apache.hadoop.fs.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(org.apache.hadoop.fs.Path src) throws IOException
src
- the path to clear the quota ofIOException
- in the event of errorpublic void setSpaceQuota(org.apache.hadoop.fs.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(org.apache.hadoop.fs.Path src) throws IOException
src
- the path to clear the space quota ofIOException
- in the event of errorpublic void allowSnapshot(org.apache.hadoop.fs.Path path) throws IOException
path
- The path of the directory where snapshots will be taken.IOException
public void disallowSnapshot(org.apache.hadoop.fs.Path path) throws IOException
path
- The path of the snapshottable directory.IOException
public long addCacheDirective(CacheDirectiveInfo info, EnumSet<CacheFlag> flags) throws IOException
info
- Information about a directive to add.flags
- CacheFlag
s to use for this operation.IOException
- if the directive could not be addedpublic void modifyCacheDirective(CacheDirectiveInfo info, EnumSet<CacheFlag> flags) throws IOException
info
- Information about the directive to modify. You must set the ID
to indicate which CacheDirective you want to modify.flags
- CacheFlag
s to use for this operation.IOException
- if the directive could not be modifiedpublic void removeCacheDirective(long id) throws IOException
id
- identifier of the CacheDirectiveInfo to removeIOException
- if the directive could not be removedpublic org.apache.hadoop.fs.RemoteIterator<CacheDirectiveEntry> listCacheDirectives(CacheDirectiveInfo filter) throws IOException
filter
- Filter parameters to use when listing the directives, null to
list all directives visible to us.IOException
public void addCachePool(CachePoolInfo info) throws IOException
info
- The request to add a cache pool.IOException
- If the request could not be completed.public void modifyCachePool(CachePoolInfo info) throws IOException
info
- The request to modify a cache pool.IOException
- If the request could not be completed.public void removeCachePool(String poolName) throws IOException
poolName
- Name of the cache pool to remove.IOException
- if the cache pool did not exist, or could not be removed.public org.apache.hadoop.fs.RemoteIterator<CachePoolEntry> listCachePools() throws IOException
IOException
- If there was an error listing cache pools.Copyright © 2014 Apache Software Foundation. All Rights Reserved.