Example usage for org.apache.hadoop.yarn.webapp.hamlet Hamlet table

List of usage examples for org.apache.hadoop.yarn.webapp.hamlet Hamlet table

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.webapp.hamlet Hamlet table.

Prototype

@Override
    public TABLE<Hamlet> table() 

Source Link

Usage

From source file:org.apache.slider.server.appmaster.web.view.IndexBlock.java

License:Apache License

@VisibleForTesting
protected void doIndex(Hamlet html, String providerName) {
    ClusterDescription clusterStatus = appView.getClusterStatus();
    DIV<Hamlet> div = html.div("general_info").h1("index_header", "Application: '" + clusterStatus.name + "'");

    UL<DIV<Hamlet>> ul = div.ul();

    ul.li("Total number of containers for application: " + appView.getNumOwnedContainers());
    ul.li("Application created: " + getInfoAvoidingNulls(StatusKeys.INFO_CREATE_TIME_HUMAN));
    ul.li("Application last flexed: " + getInfoAvoidingNulls(StatusKeys.INFO_FLEX_TIME_HUMAN));
    ul.li("Application running since: " + getInfoAvoidingNulls(StatusKeys.INFO_LIVE_TIME_HUMAN));
    ul.li("Application HDFS storage path: " + clusterStatus.dataPath);
    ul.li("Application configuration path: " + clusterStatus.originConfigurationPath);

    ul._()._();//ww w .j  a  v a2  s  . c  om

    html.div("provider_info").h3(providerName + " specific information");
    ul = div.ul();
    addProviderServiceOptions(providerService, ul, clusterStatus);
    ul._()._();

    html.div("container_instances").h3("Component Instances");

    Hamlet.TABLE<DIV<Hamlet>> table = div.table();
    table.tr().th("Component").th("Desired").th("Actual").th("Outstanding Requests").th("Failed")
            .th("Failed to start")._();

    List<RoleStatus> roleStatuses = appView.cloneRoleStatusList();
    Collections.sort(roleStatuses, new RoleStatus.CompareByName());
    for (RoleStatus status : roleStatuses) {
        table.tr().td(status.getName()).th(String.format("%d", status.getDesired()))
                .th(String.format("%d", status.getActual())).th(String.format("%d", status.getRequested()))
                .th(String.format("%d", status.getFailed())).th(String.format("%d", status.getStartFailed()))
                ._();
    }

    table._()._();
}