/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
/** * Returns an attribute-value map derived from the factory attributes * by finding all factory attributes that begin with * <i>contextName</i>.<i>tableName</i>. The returned map consists of * those attributes with the contextName and tableName stripped off. */ protected Map<String,String> getAttributeTable(String tableName) { String prefix = contextName + "." + tableName + "."; Map<String,String> result = new HashMap<String,String>(); for (String attributeName : factory.getAttributeNames()) { if (attributeName.startsWith(prefix)) { String name = attributeName.substring(prefix.length()); String value = (String) factory.getAttribute(attributeName); result.put(name, value); } } return result; }
/** * Convenience method for subclasses to access factory attributes. */ protected String getAttribute(String attributeName) { String factoryAttribute = contextName + "." + attributeName; return (String) factory.getAttribute(factoryAttribute); }
if (metricsContext == null) { String classNameAttribute = refName + CONTEXT_CLASS_SUFFIX; String className = (String) getAttribute(classNameAttribute); if (className == null) { className = DEFAULT_CONTEXT_CLASSNAME;
if (metricsContext == null) { String classNameAttribute = refName + CONTEXT_CLASS_SUFFIX; String className = (String) getAttribute(classNameAttribute); if (className == null) { className = DEFAULT_CONTEXT_CLASSNAME;
if (metricsContext == null) { String classNameAttribute = refName + CONTEXT_CLASS_SUFFIX; String className = (String) getAttribute(classNameAttribute); if (className == null) { className = DEFAULT_CONTEXT_CLASSNAME;
if (metricsContext == null) { String classNameAttribute = refName + CONTEXT_CLASS_SUFFIX; String className = (String) getAttribute(classNameAttribute); if (className == null) { className = DEFAULT_CONTEXT_CLASSNAME;
public RegionServerMetrics() { MetricsContext context = MetricsUtil.getContext("hbase"); metricsRecord = MetricsUtil.createRecord(context, "regionserver"); String name = Thread.currentThread().getName(); metricsRecord.setTag("RegionServer", name); context.registerUpdater(this); // Add jvmmetrics. JvmMetrics.init("RegionServer", name); // Add Hbase Info metrics HBaseInfo.init(); // export for JMX statistics = new RegionServerStatistics(this.registry, name); // get custom attributes try { Object m = ContextFactory.getFactory().getAttribute("hbase.extendedperiod"); if (m instanceof String) { this.extendedPeriod = Long.parseLong((String) m)*1000; } } catch (IOException ioe) { LOG.info("Couldn't load ContextFactory for Metrics config info"); } LOG.info("Initialized"); }
public MasterMetrics(final String name) { MetricsContext context = MetricsUtil.getContext("hbase"); metricsRecord = MetricsUtil.createRecord(context, "master"); metricsRecord.setTag("Master", name); context.registerUpdater(this); JvmMetrics.init("Master", name); HBaseInfo.init(); // expose the MBean for metrics masterStatistics = new MasterStatistics(this.registry); // get custom attributes try { Object m = ContextFactory.getFactory().getAttribute("hbase.extendedperiod"); if (m instanceof String) { this.extendedPeriod = Long.parseLong((String) m)*1000; } } catch (IOException ioe) { LOG.info("Couldn't load ContextFactory for Metrics config info"); } LOG.info("Initialized"); }