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 ji...@apache.org on 2014/10/18 01:31:21 UTC

[34/34] git commit: HDFS-7171. Fix Jenkins failures in HDFS-6581 branch. (Arpit Agarwal)

HDFS-7171. Fix Jenkins failures in HDFS-6581 branch. (Arpit Agarwal)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt
	hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java


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

Branch: refs/heads/branch-2.6
Commit: 137f0b8cbfd496cae2750f1bf219d2e6a84b9fe2
Parents: e6457a0
Author: arp <ar...@apache.org>
Authored: Tue Sep 30 18:25:20 2014 -0700
Committer: Jitendra Pandey <Ji...@Jitendra-Pandeys-MacBook-Pro-4.local>
Committed: Fri Oct 17 16:00:53 2014 -0700

----------------------------------------------------------------------
 .../hdfs/server/namenode/FSNamesystem.java      |  1 -
 .../hadoop/hdfs/TestBlockStoragePolicy.java     | 12 ++++-
 .../hdfs/server/mover/TestStorageMover.java     | 52 --------------------
 3 files changed, 11 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/137f0b8c/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 3639b2f..639faf3 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -2356,7 +2356,6 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
       }
 
       src = FSDirectory.resolvePath(src, pathComponents, dir);
-      INode inode = dir.getINode(src);
 
       // get the corresponding policy and make sure the policy name is valid
       BlockStoragePolicy policy = blockManager.getStoragePolicy(policyName);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/137f0b8c/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
index e89d406..cf032a9 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
@@ -71,6 +71,7 @@ public class TestBlockStoragePolicy {
   static final byte HOT  = HdfsConstants.HOT_STORAGE_POLICY_ID;
   static final byte ONESSD  = HdfsConstants.ONESSD_STORAGE_POLICY_ID;
   static final byte ALLSSD  = HdfsConstants.ALLSSD_STORAGE_POLICY_ID;
+  static final byte LAZY_PERSIST  = HdfsConstants.LAZY_PERSIST_STORAGE_POLICY_ID;
 
   @Test (timeout=300000)
   public void testConfigKeyEnabled() throws IOException {
@@ -126,6 +127,9 @@ public class TestBlockStoragePolicy {
     expectedPolicyStrings.put(ALLSSD, "BlockStoragePolicy{ALL_SSD:" + ALLSSD +
         ", storageTypes=[SSD], creationFallbacks=[DISK], " +
         "replicationFallbacks=[DISK]}");
+    expectedPolicyStrings.put(LAZY_PERSIST,
+        "BlockStoragePolicy{LAZY_PERSIST:" + LAZY_PERSIST + ", storageTypes=[RAM_DISK, DISK], " +
+            "creationFallbacks=[DISK], replicationFallbacks=[DISK]}");
 
     for(byte i = 1; i < 16; i++) {
       final BlockStoragePolicy policy = POLICY_SUITE.getPolicy(i); 
@@ -1151,13 +1155,19 @@ public class TestBlockStoragePolicy {
     final DistributedFileSystem fs = cluster.getFileSystem();
     try {
       BlockStoragePolicy[] policies = fs.getStoragePolicies();
-      Assert.assertEquals(5, policies.length);
+      Assert.assertEquals(6, policies.length);
       Assert.assertEquals(POLICY_SUITE.getPolicy(COLD).toString(),
           policies[0].toString());
       Assert.assertEquals(POLICY_SUITE.getPolicy(WARM).toString(),
           policies[1].toString());
       Assert.assertEquals(POLICY_SUITE.getPolicy(HOT).toString(),
           policies[2].toString());
+      Assert.assertEquals(POLICY_SUITE.getPolicy(ONESSD).toString(),
+          policies[3].toString());
+      Assert.assertEquals(POLICY_SUITE.getPolicy(ALLSSD).toString(),
+          policies[4].toString());
+      Assert.assertEquals(POLICY_SUITE.getPolicy(LAZY_PERSIST).toString(),
+          policies[5].toString());
     } finally {
       IOUtils.cleanup(null, fs);
       cluster.shutdown();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/137f0b8c/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java
index b690165..0425dc4 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestStorageMover.java
@@ -783,56 +783,4 @@ public class TestStorageMover {
       test.shutdownCluster();
     }
   }
-
-  /**
-   * Test blocks of lazy_persist file on RAM_DISK will not be moved to other
-   * storage types by the Storage Mover.
-   */
-  @Test
-  public void testRamDiskNotMoved() throws Exception {
-    LOG.info("testRamDiskNotMoved");
-    final PathPolicyMap pathPolicyMap = new PathPolicyMap(0);
-    final NamespaceScheme nsScheme = pathPolicyMap.newNamespaceScheme();
-
-    final long diskCapacity = 100 * BLOCK_SIZE;
-    final long archiveCapacity = (6 + HdfsConstants.MIN_BLOCKS_FOR_WRITE)
-      * BLOCK_SIZE;
-    final long ramDiskCapacity = 10 * BLOCK_SIZE;
-    final long[][] capacities = genCapacities(1, 0, 0, 1,
-      diskCapacity, archiveCapacity, ramDiskCapacity);
-    final int LAZY_WRITER_INTERVAL_SEC = 1;
-    final ClusterScheme clusterScheme = new ClusterScheme(DEFAULT_CONF,
-      1, (short)1, genStorageTypes(1, 0, 0, 1), capacities);
-    clusterScheme.conf.setInt(DFS_DATANODE_LAZY_WRITER_INTERVAL_SEC,
-      LAZY_WRITER_INTERVAL_SEC);
-    final MigrationTest test = new MigrationTest(clusterScheme, nsScheme);
-
-    try {
-      test.runBasicTest(false);
-
-      // test creating a hot RAM_DISK file
-      final int SEED = 0xFADED;
-      final Path foo_hot = new Path(pathPolicyMap.hot, "foo_hot");
-      DFSTestUtil.createFile(test.dfs, foo_hot, true, BLOCK_SIZE, BLOCK_SIZE,
-        BLOCK_SIZE, (short) 1, SEED, true);
-      Assert.assertTrue(DFSTestUtil.verifyFileReplicasOnStorageType(test.dfs,
-        test.dfs.getClient(), foo_hot, StorageType.RAM_DISK));
-
-     // Sleep for a short time to allow the lazy writer thread to do its job
-      Thread.sleep(6 * LAZY_WRITER_INTERVAL_SEC * 1000);
-
-      // Verify policy related name change is allowed
-      final Path foo_hot_new = new Path(pathPolicyMap.warm, "foo_hot");
-      test.dfs.rename(foo_hot, pathPolicyMap.warm);
-      Assert.assertTrue(test.dfs.exists(foo_hot_new));
-
-      // Verify blocks on ram disk will not be moved to other storage types by
-      // policy based Storage Mover.
-      test.migrate();
-      Assert.assertTrue(DFSTestUtil.verifyFileReplicasOnStorageType(test.dfs,
-        test.dfs.getClient(), foo_hot_new, StorageType.RAM_DISK));
-    } finally {
-      test.shutdownCluster();
-    }
-  }
 }