org.apache.hadoop.hdfs.client
Class HdfsAdmin

java.lang.Object
  extended by org.apache.hadoop.hdfs.client.HdfsAdmin

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class HdfsAdmin
extends Object

The public API for performing administrative functions on HDFS. Those writing applications against HDFS should prefer this interface to directly accessing functionality in DistributedFileSystem or DFSClient. Note that this is distinct from the similarly-named DFSAdmin, which is a class that provides the functionality for the CLI `hdfs dfsadmin ...' commands.


Constructor Summary
HdfsAdmin(URI uri, org.apache.hadoop.conf.Configuration conf)
          Create a new HdfsAdmin client.
 
Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HdfsAdmin

public HdfsAdmin(URI uri,
                 org.apache.hadoop.conf.Configuration conf)
          throws IOException
Create a new HdfsAdmin client.

Parameters:
uri - the unique URI of the HDFS file system to administer
conf - configuration
Throws:
IOException - in the event the file system could not be created
Method Detail

setQuota

public void setQuota(org.apache.hadoop.fs.Path src,
                     long quota)
              throws IOException
Set the namespace quota (count of files, directories, and sym links) for a directory.

Parameters:
src - the path to set the quota for
quota - the value to set for the quota
Throws:
IOException - in the event of error

clearQuota

public void clearQuota(org.apache.hadoop.fs.Path src)
                throws IOException
Clear the namespace quota (count of files, directories and sym links) for a directory.

Parameters:
src - the path to clear the quota of
Throws:
IOException - in the event of error

setSpaceQuota

public void setSpaceQuota(org.apache.hadoop.fs.Path src,
                          long spaceQuota)
                   throws IOException
Set the disk space quota (size of files) for a directory. Note that directories and sym links do not occupy disk space.

Parameters:
src - the path to set the space quota of
spaceQuota - the value to set for the space quota
Throws:
IOException - in the event of error

clearSpaceQuota

public void clearSpaceQuota(org.apache.hadoop.fs.Path src)
                     throws IOException
Clear the disk space quota (size of files) for a directory. Note that directories and sym links do not occupy disk space.

Parameters:
src - the path to clear the space quota of
Throws:
IOException - in the event of error

allowSnapshot

public void allowSnapshot(org.apache.hadoop.fs.Path path)
                   throws IOException
Allow snapshot on a directory.

Parameters:
path - The path of the directory where snapshots will be taken.
Throws:
IOException

disallowSnapshot

public void disallowSnapshot(org.apache.hadoop.fs.Path path)
                      throws IOException
Disallow snapshot on a directory.

Parameters:
path - The path of the snapshottable directory.
Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.