Java Code Examples for org.apache.hadoop.hdfs.server.blockmanagement.BlockStoragePolicySuite#createDefaultSuite()

The following examples show how to use org.apache.hadoop.hdfs.server.blockmanagement.BlockStoragePolicySuite#createDefaultSuite() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestStoragePolicySummary.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Test
public void testMultipleHots() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  sts.add(new StorageType[]{StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:1(HOT)", 1l);
  expectedOutput.put("HOT|DISK:2(HOT)", 1l);
  expectedOutput.put("HOT|DISK:3(HOT)", 1l);
  expectedOutput.put("HOT|DISK:4(HOT)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 2
Source File: TestStoragePolicySummary.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Test
public void testMultipleHotsWithDifferentCounts() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  sts.add(new StorageType[]{StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long> expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:1(HOT)", 1l);
  expectedOutput.put("HOT|DISK:2(HOT)", 2l);
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  expectedOutput.put("HOT|DISK:4(HOT)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 3
Source File: TestStoragePolicySummary.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Test
public void testMultipleHots() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  sts.add(new StorageType[]{StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:1(HOT)", 1l);
  expectedOutput.put("HOT|DISK:2(HOT)", 1l);
  expectedOutput.put("HOT|DISK:3(HOT)", 1l);
  expectedOutput.put("HOT|DISK:4(HOT)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 4
Source File: TestStoragePolicySummary.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Test
public void testMultipleHotsWithDifferentCounts() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  sts.add(new StorageType[]{StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long> expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:1(HOT)", 1l);
  expectedOutput.put("HOT|DISK:2(HOT)", 2l);
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  expectedOutput.put("HOT|DISK:4(HOT)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 5
Source File: TestStoragePolicySummary.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testMultipleWarmsInDifferentOrder() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  //DISK:1,ARCHIVE:1
  sts.add(new StorageType[]{StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,StorageType.DISK},warm);
  //DISK:2,ARCHIVE:1
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  //DISK:2,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK,StorageType.DISK},warm);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("WARM|DISK:1,ARCHIVE:1(WARM)", 2l);
  expectedOutput.put("WARM|DISK:2,ARCHIVE:1", 3l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 3l);
  expectedOutput.put("WARM|DISK:2,ARCHIVE:2", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 6
Source File: TestStoragePolicySummary.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testSortInDescendingOrder() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  BlockStoragePolicy cold = bsps.getPolicy("COLD");
  //DISK:3
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  //ARCHIVE:3
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(3,actualOutput.size());
  Map<String, Long>  expectedOutput = new LinkedHashMap<>();
  expectedOutput.put("COLD|ARCHIVE:3(COLD)", 4l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 3l);
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  Assert.assertEquals(expectedOutput.toString(),actualOutput.toString());
}
 
Example 7
Source File: TestStoragePolicyCommands.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testSetAndGetStoragePolicy() throws Exception {
  final Path foo = new Path("/foo");
  final Path bar = new Path(foo, "bar");
  DFSTestUtil.createFile(fs, bar, SIZE, REPL, 0);

  final StoragePolicyAdmin admin = new StoragePolicyAdmin(conf);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo", 0,
      "The storage policy of " + foo.toString() + " is unspecified");
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo/bar", 0,
      "The storage policy of " + bar.toString() + " is unspecified");

  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /foo -policy WARM", 0,
      "Set storage policy WARM on " + foo.toString());
  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /foo/bar -policy COLD",
      0, "Set storage policy COLD on " + bar.toString());
  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /fooz -policy WARM",
      2, "File/Directory does not exist: /fooz");

  final BlockStoragePolicySuite suite = BlockStoragePolicySuite
      .createDefaultSuite();
  final BlockStoragePolicy warm = suite.getPolicy("WARM");
  final BlockStoragePolicy cold = suite.getPolicy("COLD");
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo", 0,
      "The storage policy of " + foo.toString() + ":\n" + warm);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo/bar", 0,
      "The storage policy of " + bar.toString() + ":\n" + cold);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /fooz", 2,
      "File/Directory does not exist: /fooz");
}
 
Example 8
Source File: TestStoragePolicySummary.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Test
public void testMultipleWarmsInDifferentOrder() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  //DISK:1,ARCHIVE:1
  sts.add(new StorageType[]{StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,StorageType.DISK},warm);
  //DISK:2,ARCHIVE:1
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  //DISK:2,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK,StorageType.DISK},warm);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(4,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("WARM|DISK:1,ARCHIVE:1(WARM)", 2l);
  expectedOutput.put("WARM|DISK:2,ARCHIVE:1", 3l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 3l);
  expectedOutput.put("WARM|DISK:2,ARCHIVE:2", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 9
Source File: TestStoragePolicySummary.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Test
public void testSortInDescendingOrder() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  BlockStoragePolicy cold = bsps.getPolicy("COLD");
  //DISK:3
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},warm);
  //ARCHIVE:3
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(3,actualOutput.size());
  Map<String, Long>  expectedOutput = new LinkedHashMap<>();
  expectedOutput.put("COLD|ARCHIVE:3(COLD)", 4l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 3l);
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  Assert.assertEquals(expectedOutput.toString(),actualOutput.toString());
}
 
Example 10
Source File: TestStoragePolicyCommands.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Test
public void testSetAndGetStoragePolicy() throws Exception {
  final Path foo = new Path("/foo");
  final Path bar = new Path(foo, "bar");
  DFSTestUtil.createFile(fs, bar, SIZE, REPL, 0);

  final StoragePolicyAdmin admin = new StoragePolicyAdmin(conf);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo", 0,
      "The storage policy of " + foo.toString() + " is unspecified");
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo/bar", 0,
      "The storage policy of " + bar.toString() + " is unspecified");

  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /foo -policy WARM", 0,
      "Set storage policy WARM on " + foo.toString());
  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /foo/bar -policy COLD",
      0, "Set storage policy COLD on " + bar.toString());
  DFSTestUtil.toolRun(admin, "-setStoragePolicy -path /fooz -policy WARM",
      2, "File/Directory does not exist: /fooz");

  final BlockStoragePolicySuite suite = BlockStoragePolicySuite
      .createDefaultSuite();
  final BlockStoragePolicy warm = suite.getPolicy("WARM");
  final BlockStoragePolicy cold = suite.getPolicy("COLD");
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo", 0,
      "The storage policy of " + foo.toString() + ":\n" + warm);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /foo/bar", 0,
      "The storage policy of " + bar.toString() + ":\n" + cold);
  DFSTestUtil.toolRun(admin, "-getStoragePolicy -path /fooz", 2,
      "File/Directory does not exist: /fooz");
}
 
Example 11
Source File: TestStoragePolicySummary.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Test
public void testDifferentSpecifiedPolicies() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  BlockStoragePolicy cold = bsps.getPolicy("COLD");
  //DISK:3
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},cold);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},cold);
  //ARCHIVE:3
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(9,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  expectedOutput.put("COLD|DISK:1,ARCHIVE:2(WARM)", 2l);
  expectedOutput.put("HOT|ARCHIVE:3(COLD)", 2l);
  expectedOutput.put("WARM|DISK:3(HOT)", 1l);
  expectedOutput.put("COLD|DISK:3(HOT)", 1l);
  expectedOutput.put("WARM|ARCHIVE:3(COLD)", 1l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 1l);
  expectedOutput.put("COLD|ARCHIVE:3(COLD)", 1l);
  expectedOutput.put("HOT|DISK:1,ARCHIVE:2(WARM)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}
 
Example 12
Source File: TestStoragePolicySummary.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Test
public void testDifferentSpecifiedPolicies() {
  BlockStoragePolicySuite bsps = BlockStoragePolicySuite.createDefaultSuite();
  StoragePolicySummary sts = new StoragePolicySummary(bsps.getAllPolicies());
  BlockStoragePolicy hot = bsps.getPolicy("HOT");
  BlockStoragePolicy warm = bsps.getPolicy("WARM");
  BlockStoragePolicy cold = bsps.getPolicy("COLD");
  //DISK:3
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},hot);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},warm);
  sts.add(new StorageType[]{StorageType.DISK,StorageType.DISK,StorageType.DISK},cold);
  //DISK:1,ARCHIVE:2
  sts.add(new StorageType[]{StorageType.DISK,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.DISK,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},cold);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.DISK},cold);
  //ARCHIVE:3
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},hot);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},warm);
  sts.add(new StorageType[]{StorageType.ARCHIVE,
      StorageType.ARCHIVE,StorageType.ARCHIVE},cold);
  Map<String, Long> actualOutput = convertToStringMap(sts);
  Assert.assertEquals(9,actualOutput.size());
  Map<String, Long>  expectedOutput = new HashMap<>();
  expectedOutput.put("HOT|DISK:3(HOT)", 2l);
  expectedOutput.put("COLD|DISK:1,ARCHIVE:2(WARM)", 2l);
  expectedOutput.put("HOT|ARCHIVE:3(COLD)", 2l);
  expectedOutput.put("WARM|DISK:3(HOT)", 1l);
  expectedOutput.put("COLD|DISK:3(HOT)", 1l);
  expectedOutput.put("WARM|ARCHIVE:3(COLD)", 1l);
  expectedOutput.put("WARM|DISK:1,ARCHIVE:2(WARM)", 1l);
  expectedOutput.put("COLD|ARCHIVE:3(COLD)", 1l);
  expectedOutput.put("HOT|DISK:1,ARCHIVE:2(WARM)", 1l);
  Assert.assertEquals(expectedOutput,actualOutput);
}