HDFS-10914. Move remnants of oah.hdfs.client to hadoop-hdfs-client.
(cherry picked from commit 92e5e91598
)
Conflicts:
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
This commit is contained in:
parent
4f8c7f819c
commit
b12f004474
|
@ -68,4 +68,3 @@ public enum CreateEncryptionZoneFlag {
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,14 +45,13 @@ import org.apache.hadoop.hdfs.protocol.CachePoolInfo;
|
||||||
import org.apache.hadoop.hdfs.protocol.EncryptionZone;
|
import org.apache.hadoop.hdfs.protocol.EncryptionZone;
|
||||||
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
||||||
import org.apache.hadoop.security.AccessControlException;
|
import org.apache.hadoop.security.AccessControlException;
|
||||||
import org.apache.hadoop.hdfs.tools.DFSAdmin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The public API for performing administrative functions on HDFS. Those writing
|
* The public API for performing administrative functions on HDFS. Those writing
|
||||||
* applications against HDFS should prefer this interface to directly accessing
|
* applications against HDFS should prefer this interface to directly accessing
|
||||||
* functionality in DistributedFileSystem or DFSClient.
|
* functionality in DistributedFileSystem or DFSClient.
|
||||||
*
|
*
|
||||||
* Note that this is distinct from the similarly-named {@link DFSAdmin}, which
|
* Note that this is distinct from the similarly-named DFSAdmin, which
|
||||||
* is a class that provides the functionality for the CLI `hdfs dfsadmin ...'
|
* is a class that provides the functionality for the CLI `hdfs dfsadmin ...'
|
||||||
* commands.
|
* commands.
|
||||||
*/
|
*/
|
|
@ -20,8 +20,7 @@ package org.apache.hadoop.hdfs.client;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.classification.InterfaceStability;
|
import org.apache.hadoop.classification.InterfaceStability;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
@ -30,7 +29,8 @@ import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.hdfs.DistributedFileSystem;
|
import org.apache.hadoop.hdfs.DistributedFileSystem;
|
||||||
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
|
||||||
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
import org.apache.hadoop.hdfs.protocol.HdfsConstants.SafeModeAction;
|
||||||
import org.apache.hadoop.io.IOUtils;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The public utility API for HDFS.
|
* The public utility API for HDFS.
|
||||||
|
@ -38,7 +38,7 @@ import org.apache.hadoop.io.IOUtils;
|
||||||
@InterfaceAudience.Public
|
@InterfaceAudience.Public
|
||||||
@InterfaceStability.Evolving
|
@InterfaceStability.Evolving
|
||||||
public class HdfsUtils {
|
public class HdfsUtils {
|
||||||
private static final Log LOG = LogFactory.getLog(HdfsUtils.class);
|
public static final Logger LOG = LoggerFactory.getLogger(HdfsUtils.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the HDFS healthy?
|
* Is the HDFS healthy?
|
||||||
|
@ -80,7 +80,7 @@ public class HdfsUtils {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.cleanup(LOG, fs);
|
IOUtils.closeQuietly(fs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue