Search in sources :

Example 1 with AngelConf

use of com.tencent.angel.conf.AngelConf in project angel by Tencent.

the class EnvironmentBlock method render.

@Override
protected void render(Block html) {
    set(TITLE, join("Angel Environment"));
    html.h1("Runtime Information");
    TABLE<Hamlet> run_info_table = html.table();
    String UsrHome = System.getProperty("user.home");
    String UsrDir = System.getProperty("user.dir");
    String UsrName = System.getProperty("user.name");
    String JavaHome = System.getProperty("java.home");
    String OsNmae = System.getProperty("os.name");
    String JavaVersion = System.getProperty("java.version");
    run_info_table.tr().th(_TH, "NAME").th(_TH, "VALUE")._();
    run_info_table.tr().td("UsrHome").td(UsrHome)._().tr().td("UsrDir").td(UsrDir)._().tr().td("UsrName").td(UsrName)._().tr().td("JavaHome").td(JavaHome)._().tr().td("OsNmae").td(OsNmae)._().tr().td("JavaVersion").td(JavaVersion)._();
    run_info_table._();
    html.h1("    ");
    html.h1("Angel Properties");
    TABLE<Hamlet> angel_properties_table = html.table();
    angel_properties_table.tr().th(_TH, "NAME").th(_TH, "VALUE")._();
    AngelConf angelConfiguration = new AngelConf(this.amContext.getConf());
    Properties propertiesConfiguration = angelConfiguration.getAngelProps();
    SortedMap sortedMap = new TreeMap(propertiesConfiguration);
    Set<Object> set = sortedMap.keySet();
    Iterator<Object> propertiesSortedKeys = set.iterator();
    Object key;
    while (propertiesSortedKeys.hasNext()) {
        key = propertiesSortedKeys.next();
        angel_properties_table.tr().td(String.valueOf(key)).td((String) propertiesConfiguration.get(key))._();
    }
    angel_properties_table._();
    html.h1("    ");
    TBODY<TABLE<Hamlet>> tbody = html.h1("System Properties").table("#jobs").thead().tr().th(_TH, "NAME").th(_TH, "VALUE")._()._().tbody();
    Properties properties = System.getProperties();
    String propertiesName;
    String propertiesValue;
    for (Iterator<?> names = (Iterator<?>) properties.propertyNames(); names.hasNext(); ) {
        propertiesName = (String) names.next();
        propertiesValue = properties.getProperty(propertiesName);
        tbody.tr().td(propertiesName).td(propertiesValue).td().span().$title(propertiesName)._()._().td().span().$title(propertiesValue)._()._()._();
    }
    tbody._()._();
}
Also used : Hamlet(org.apache.hadoop.yarn.webapp.hamlet.Hamlet) AngelConf(com.tencent.angel.conf.AngelConf) TABLE(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE)

Aggregations

AngelConf (com.tencent.angel.conf.AngelConf)1 Hamlet (org.apache.hadoop.yarn.webapp.hamlet.Hamlet)1 TABLE (org.apache.hadoop.yarn.webapp.hamlet.Hamlet.TABLE)1