You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by vi...@apache.org on 2015/08/14 12:54:16 UTC
[02/50] hadoop git commit: HDFS-8336. Expose some administrative
erasure coding operations to HdfsAdmin (Contributed by Uma Maheswara Rao G)
HDFS-8336. Expose some administrative erasure coding operations to HdfsAdmin (Contributed by Uma Maheswara Rao G)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6712efe1
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6712efe1
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6712efe1
Branch: refs/heads/HDFS-7285-REBASE
Commit: 6712efe1e2a0107b3449eeaec4215ebbb3333e69
Parents: c89eb05
Author: Vinayakumar B <vi...@apache.org>
Authored: Tue Jun 2 16:38:43 2015 +0530
Committer: Vinayakumar B <vi...@apache.org>
Committed: Thu Aug 13 16:59:55 2015 +0530
----------------------------------------------------------------------
.../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt | 3 ++
.../apache/hadoop/hdfs/client/HdfsAdmin.java | 40 ++++++++++++++++++++
2 files changed, 43 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/6712efe1/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
index 01d8cf0..e7335b2 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
@@ -265,3 +265,6 @@
HDFS-8481. Erasure coding: remove workarounds in client side stripped blocks
recovering. (zhz)
+
+ HDFS-8336. Expose some administrative erasure coding operations to HdfsAdmin
+ (Uma Maheswara Rao G via vinayakumarb)
http://git-wip-us.apache.org/repos/asf/hadoop/blob/6712efe1/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
index 84499bb..5a3c885 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsAdmin.java
@@ -37,9 +37,11 @@ import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo;
import org.apache.hadoop.hdfs.protocol.CachePoolEntry;
import org.apache.hadoop.hdfs.protocol.CachePoolInfo;
import org.apache.hadoop.hdfs.protocol.EncryptionZone;
+import org.apache.hadoop.hdfs.protocol.ErasureCodingZone;
import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.hdfs.tools.DFSAdmin;
+import org.apache.hadoop.io.erasurecode.ECSchema;
/**
* The public API for performing administrative functions on HDFS. Those writing
@@ -363,4 +365,42 @@ public class HdfsAdmin {
throws IOException {
dfs.setStoragePolicy(src, policyName);
}
+
+ /**
+ * Create the ErasureCoding zone
+ *
+ * @param path
+ * Directory to create the ErasureCoding zone
+ * @param schema
+ * ECSchema for the zone. If not specified default will be used.
+ * @param cellSize
+ * Cellsize for the striped ErasureCoding
+ * @throws IOException
+ */
+ public void createErasureCodingZone(final Path path, final ECSchema schema,
+ final int cellSize) throws IOException {
+ dfs.createErasureCodingZone(path, schema, cellSize);
+ }
+
+ /**
+ * Get the ErasureCoding zone information for the specified path
+ *
+ * @param path
+ * @return Returns the zone information if path is in EC zone, null otherwise
+ * @throws IOException
+ */
+ public ErasureCodingZone getErasureCodingZone(final Path path)
+ throws IOException {
+ return dfs.getErasureCodingZone(path);
+ }
+
+ /**
+ * Get the ErasureCoding schemas supported.
+ *
+ * @return ECSchemas
+ * @throws IOException
+ */
+ public ECSchema[] getECSchemas() throws IOException {
+ return dfs.getClient().getECSchemas();
+ }
}