hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [14/50] [abbrv] hadoop git commit: HDFS-13932. [JDK 11] Casts to BlockStoragePolicy[] in unit tests raise ClassCastExceptions. Contributed by Andrew Purtell.
Date Tue, 02 Oct 2018 21:40:14 GMT
HDFS-13932. [JDK 11] Casts to BlockStoragePolicy[] in unit tests raise ClassCastExceptions.
Contributed by Andrew Purtell.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f9c02216
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f9c02216
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f9c02216

Branch: refs/heads/HDFS-13532
Commit: f9c0221623ee5849453f7ec9021d1697e9677805
Parents: 6b988d8
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Thu Sep 27 11:44:42 2018 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Thu Sep 27 11:44:42 2018 +0900

----------------------------------------------------------------------
 .../org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java | 7 +------
 .../test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java    | 8 ++------
 2 files changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f9c02216/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
index 0ffb62c..c7dc6f8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
@@ -38,7 +38,6 @@ import org.apache.hadoop.hdfs.AppendTestUtil;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.DFSTestUtil;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
-import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
 import org.apache.hadoop.hdfs.protocol.HdfsConstants;
 import org.apache.hadoop.hdfs.protocol.SnapshotException;
 import org.apache.hadoop.hdfs.web.WebHdfsFileSystem;
@@ -1029,13 +1028,9 @@ public abstract class BaseTestHttpFSWith extends HFSTestCase {
     Path path = new Path(getProxiedFSTestDir(), "policy.txt");
     FileSystem httpfs = getHttpFSFileSystem();
     // test getAllStoragePolicies
-    BlockStoragePolicy[] dfsPolicies = (BlockStoragePolicy[]) fs
-       .getAllStoragePolicies().toArray();
-    BlockStoragePolicy[] httpPolicies = (BlockStoragePolicy[]) httpfs
-        .getAllStoragePolicies().toArray();
     Assert.assertArrayEquals(
         "Policy array returned from the DFS and HttpFS should be equals",
-        dfsPolicies, httpPolicies);
+        fs.getAllStoragePolicies().toArray(), httpfs.getAllStoragePolicies().toArray());
 
     // test get/set/unset policies
     DFSTestUtil.createFile(fs, path, 0, (short) 1, 0L);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f9c02216/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
index a766de6..d7ed46b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java
@@ -81,7 +81,6 @@ import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.TestDFSClientRetries;
 import org.apache.hadoop.hdfs.TestFileCreation;
 import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
-import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
 import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
 import org.apache.hadoop.hdfs.protocol.SystemErasureCodingPolicies;
 import org.apache.hadoop.hdfs.protocol.HdfsConstants;
@@ -1405,11 +1404,8 @@ public class TestWebHDFS {
           conf, WebHdfsConstants.WEBHDFS_SCHEME);
 
       // test getAllStoragePolicies
-      BlockStoragePolicy[] dfsPolicies = (BlockStoragePolicy[]) dfs
-          .getAllStoragePolicies().toArray();
-      BlockStoragePolicy[] webHdfsPolicies = (BlockStoragePolicy[]) webHdfs
-          .getAllStoragePolicies().toArray();
-      Assert.assertTrue(Arrays.equals(dfsPolicies, webHdfsPolicies));
+      Assert.assertTrue(Arrays.equals(dfs.getAllStoragePolicies().toArray(),
+          webHdfs.getAllStoragePolicies().toArray()));
 
       // test get/set/unset policies
       DFSTestUtil.createFile(dfs, path, 0, (short) 1, 0L);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message