@Test public void testGetPropertyInfoMap() { AbstractPropertyProvider provider = new TestPropertyProvider(PropertyHelper.getMetricPropertyIds(Resource.Type.HostComponent)); Map<String, PropertyInfo> propertyInfoMap = provider.getPropertyInfoMap("NAMENODE", "metrics/cpu/cpu_aidle"); Assert.assertEquals(1, propertyInfoMap.size()); Assert.assertTrue(propertyInfoMap.containsKey("metrics/cpu/cpu_aidle")); propertyInfoMap = provider.getPropertyInfoMap("NAMENODE", "metrics/disk"); Assert.assertEquals(3, propertyInfoMap.size()); Assert.assertTrue(propertyInfoMap.containsKey("metrics/disk/disk_free")); Assert.assertTrue(propertyInfoMap.containsKey("metrics/disk/disk_total")); Assert.assertTrue(propertyInfoMap.containsKey("metrics/disk/part_max_used")); }
protected Map<String, PropertyInfo> getPropertyInfoMap(String componentName, String propertyId) { Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>(); updatePropertyInfoMap(componentName, propertyId, propertyInfoMap); return propertyInfoMap; }
AbstractPropertyProvider extends BaseProvider implements PropertyProvider { protected Map<String, PropertyInfo> getPropertyInfoMap(String componentName, String propertyId) { Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>(); updatePropertyInfoMap(componentName, propertyId, propertyInfoMap); return propertyInfoMap; } }
AbstractPropertyProvider extends BaseProvider implements PropertyProvider { protected Map<String, PropertyInfo> getPropertyInfoMap(String componentName, String propertyId) { Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>(); updatePropertyInfoMap(componentName, propertyId, propertyInfoMap); return propertyInfoMap; } AbstractPropertyProvider(Map<String, Map<String, PropertyInfo>> componentMetrics); }
AbstractPropertyProvider extends BaseProvider implements PropertyProvider { protected Map<String, PropertyInfo> getPropertyInfoMap(String componentName, String propertyId) { Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>(); updatePropertyInfoMap(componentName, propertyId, propertyInfoMap); return propertyInfoMap; } AbstractPropertyProvider(Map<String, Map<String, PropertyInfo>> componentMetrics); Map<String, Map<String, PropertyInfo>> getComponentMetrics(); }
AbstractPropertyProvider extends BaseProvider implements PropertyProvider { protected Map<String, PropertyInfo> getPropertyInfoMap(String componentName, String propertyId) { Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>(); updatePropertyInfoMap(componentName, propertyId, propertyInfoMap); return propertyInfoMap; } AbstractPropertyProvider(Map<String, Map<String, PropertyInfo>> componentMetrics); Map<String, Map<String, PropertyInfo>> getComponentMetrics();  }