@Test public void sameTierView() { String tierAlias = mMetaManager.getTiers().get(TEST_TIER_ORDINAL).getTierAlias(); StorageTierView tierView1 = mMetadataView.getTierView(tierAlias); StorageDir dir = mMetaManager.getTiers().get(TEST_TIER_ORDINAL).getDir(TEST_DIR); BlockMeta blockMeta = new BlockMeta(TEST_BLOCK_ID, TEST_BLOCK_SIZE, dir); try { dir.addBlockMeta(blockMeta); } catch (Exception e) { e.printStackTrace(); } StorageTierEvictorView tierView2 = new StorageTierEvictorView(mMetaManager.getTier(tierAlias), mMetadataView); assertSameTierView((StorageTierEvictorView) tierView1, tierView2); }
public StorageTierView getTierView(String tierAlias) { StorageTierView tierView = mAliasToTierViews.get(tierAlias); if (tierView == null) { throw new IllegalArgumentException( ExceptionMessage.TIER_VIEW_ALIAS_NOT_FOUND.getMessage(tierAlias)); } else { return tierView; } }
BlockMetadataView { public StorageTierView getTierView(String tierAlias) { StorageTierView tierView = mAliasToTierViews.get(tierAlias); if (tierView == null) { throw new IllegalArgumentException( ExceptionMessage.TIER_VIEW_ALIAS_NOT_FOUND.getMessage(tierAlias)); } else { return tierView; } } }
BlockMetadataView { public StorageTierView getTierView(String tierAlias) { StorageTierView tierView = mAliasToTierViews.get(tierAlias); if (tierView == null) { throw new IllegalArgumentException( ExceptionMessage.TIER_VIEW_ALIAS_NOT_FOUND.getMessage(tierAlias)); } else { return tierView; } } BlockMetadataView(BlockMetadataManager manager);  BlockMetadataView(BlockMetadataManager manager, boolean useReservedSpace); }
BlockMetadataView { public StorageTierView getTierView(String tierAlias) { StorageTierView tierView = mAliasToTierViews.get(tierAlias); if (tierView == null) { throw new IllegalArgumentException( ExceptionMessage.TIER_VIEW_ALIAS_NOT_FOUND.getMessage(tierAlias)); } else { return tierView; } } BlockMetadataView(BlockMetadataManager manager);  BlockMetadataView(BlockMetadataManager manager, boolean useReservedSpace); StorageTierView getTierView(String tierAlias); List<StorageTierView> getTierViews(); @Nullable StorageTierView getNextTier(StorageTierView tierView); List<StorageTierView> getTierViewsBelow(String tierAlias); BlockMetadataView refreshView(); }
BlockMetadataView { public StorageTierView getTierView(String tierAlias) { StorageTierView tierView = mAliasToTierViews.get(tierAlias); if (tierView == null) { throw new IllegalArgumentException( ExceptionMessage.TIER_VIEW_ALIAS_NOT_FOUND.getMessage(tierAlias)); } else { return tierView; } } BlockMetadataView(BlockMetadataManager manager);  BlockMetadataView(BlockMetadataManager manager, boolean useReservedSpace); StorageTierView getTierView(String tierAlias); List<StorageTierView> getTierViews(); @Nullable StorageTierView getNextTier(StorageTierView tierView); List<StorageTierView> getTierViewsBelow(String tierAlias); BlockMetadataView refreshView();  }