From 65593d58c4c13b171f0bada878dd94e808152962 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Fri, 28 Jul 2017 15:55:10 -0700 Subject: [PATCH] HDFS-12223. Rebasing HDFS-10467. Contributed by Inigo Goiri. (cherry picked from commit 47db6e9d8e2c264671c89fdd6cb11a7c762d2cce) (cherry picked from commit 0ec82b8cdfaaa5f23d1a0f7f7fb8c9187c5e309b) --- .../federation/router/RouterRpcServer.java | 59 ++++++++++++++++--- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java index 4bae71e596e..eaaab39043a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java @@ -64,8 +64,9 @@ import org.apache.hadoop.hdfs.AddBlockFlag; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.inotify.EventBatchList; -import org.apache.hadoop.hdfs.protocol.AddingECPolicyResponse; +import org.apache.hadoop.hdfs.protocol.AddECPolicyResponse; import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy; +import org.apache.hadoop.hdfs.protocol.BlocksStats; import org.apache.hadoop.hdfs.protocol.CacheDirectiveEntry; import org.apache.hadoop.hdfs.protocol.CacheDirectiveInfo; import org.apache.hadoop.hdfs.protocol.CachePoolEntry; @@ -75,6 +76,7 @@ import org.apache.hadoop.hdfs.protocol.CorruptFileBlocks; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.protocol.DirectoryListing; +import org.apache.hadoop.hdfs.protocol.ECBlockGroupsStats; import org.apache.hadoop.hdfs.protocol.EncryptionZone; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; @@ -85,6 +87,7 @@ import org.apache.hadoop.hdfs.protocol.HdfsFileStatus; import org.apache.hadoop.hdfs.protocol.LastBlockWithStatus; import org.apache.hadoop.hdfs.protocol.LocatedBlock; import org.apache.hadoop.hdfs.protocol.LocatedBlocks; +import org.apache.hadoop.hdfs.protocol.OpenFileEntry; import org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo; import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport; import org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus; @@ -1735,13 +1738,6 @@ public class RouterRpcServer extends AbstractService implements ClientProtocol { checkOperation(OperationCategory.WRITE, false); } - @Override // ClientProtocol - public AddingECPolicyResponse[] addErasureCodingPolicies( - ErasureCodingPolicy[] policies) throws IOException { - checkOperation(OperationCategory.WRITE, false); - return null; - } - @Override // ClientProtocol public void unsetErasureCodingPolicy(String src) throws IOException { checkOperation(OperationCategory.WRITE, false); @@ -1808,6 +1804,53 @@ public class RouterRpcServer extends AbstractService implements ClientProtocol { return null; } + @Override + public AddECPolicyResponse[] addErasureCodingPolicies( + ErasureCodingPolicy[] arg0) throws IOException { + checkOperation(OperationCategory.WRITE, false); + return null; + } + + @Override + public void removeErasureCodingPolicy(String arg0) throws IOException { + checkOperation(OperationCategory.WRITE, false); + } + + @Override + public void disableErasureCodingPolicy(String arg0) throws IOException { + checkOperation(OperationCategory.WRITE, false); + } + + @Override + public void enableErasureCodingPolicy(String arg0) throws IOException { + checkOperation(OperationCategory.WRITE, false); + } + + @Override + public ECBlockGroupsStats getECBlockGroupsStats() throws IOException { + checkOperation(OperationCategory.READ, false); + return null; + } + + @Override + public HashMap getErasureCodingCodecs() throws IOException { + checkOperation(OperationCategory.READ, false); + return null; + } + + @Override + public BlocksStats getBlocksStats() throws IOException { + checkOperation(OperationCategory.READ, false); + return null; + } + + @Override + public BatchedEntries listOpenFiles(long arg0) + throws IOException { + checkOperation(OperationCategory.READ, false); + return null; + } + /** * Locate the location with the matching block pool id. *