<commit_before>package org.safehaus.kiskis.mgmt.ui.hadoop.manager;

import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Label;
import com.vaadin.ui.TreeTable;
import org.safehaus.kiskis.mgmt.api.hadoop.Config;
import org.safehaus.kiskis.mgmt.ui.hadoop.HadoopUI;

import java.util.List;

/**
 * Created by daralbaev on 12.04.14.
 */
public class HadoopTable extends TreeTable {

    protected static final String CLUSTER_NAME_PROPERTY = "Cluster Name";
    protected static final String DOMAIN_NAME_PROPERTY = "Domain Name";
    protected static final String NAMENODE_PROPERTY = "NameNode/DataNodes";
    protected static final String SECONDARY_NAMENODE_PROPERTY = "Secondary NameNode";
    protected static final String JOBTRACKER_PROPERTY = "JobTracker/TaskTrackers";
    protected static final String REPLICATION_PROPERTY = "Replication Factor";

    public HadoopTable(String caption) {
        setCaption(caption);

        this.setWidth("100%");
        this.setHeight(100, Sizeable.UNITS_PERCENTAGE);

        this.setPageLength(10);
        this.setSelectable(true);
        this.setImmediate(true);

        addContainerProperty(CLUSTER_NAME_PROPERTY, String.class, null);
        addContainerProperty(DOMAIN_NAME_PROPERTY, String.class, null);
        addContainerProperty(NAMENODE_PROPERTY, Label.class, null);
        addContainerProperty(SECONDARY_NAMENODE_PROPERTY, Label.class, null);
        addContainerProperty(JOBTRACKER_PROPERTY, Label.class, null);
        addContainerProperty(REPLICATION_PROPERTY, Integer.class, null);

        refreshDataSource();
    }

    public void refreshDataSource() {
        removeAllItems();

        final Object parentId = addItem(new Object[]{
                "All clusters",
                null,
                null,
                null,
                null,
                null
        });
        List<Config> list = HadoopUI.getHadoopManager().getClusters();
        for (Config cluster : list) {
            Object rowId = addItem(new Object[]{
                    cluster.getClusterName(),
                    cluster.getDomainName(),
                    null,
                    null,
                    null,
                    null
            });
            setParent(parentId, rowId);
        }
    }
}<commit_msg>Hadoop Manager in progress<commit_after>package org.safehaus.kiskis.mgmt.ui.hadoop.manager;

import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Label;
import com.vaadin.ui.TreeTable;
import org.safehaus.kiskis.mgmt.api.hadoop.Config;
import org.safehaus.kiskis.mgmt.ui.hadoop.HadoopUI;

import java.util.List;

/**
 * Created by daralbaev on 12.04.14.
 */
public class HadoopTable extends TreeTable {

    protected static final String CLUSTER_NAME_PROPERTY = "Cluster Name";
    protected static final String DOMAIN_NAME_PROPERTY = "Domain Name";
    protected static final String NAMENODE_PROPERTY = "NameNode/DataNodes";
    protected static final String SECONDARY_NAMENODE_PROPERTY = "Secondary NameNode";
    protected static final String JOBTRACKER_PROPERTY = "JobTracker/TaskTrackers";
    protected static final String REPLICATION_PROPERTY = "Replication Factor";

    private Label indicator;

    public HadoopTable(String caption, Label indicator) {
        this.indicator = indicator;
        setCaption(caption);

        this.setWidth("100%");
        this.setHeight(100, Sizeable.UNITS_PERCENTAGE);

        this.setPageLength(10);
        this.setSelectable(true);
        this.setImmediate(true);

        addContainerProperty(CLUSTER_NAME_PROPERTY, String.class, null);
        addContainerProperty(DOMAIN_NAME_PROPERTY, String.class, null);
        addContainerProperty(NAMENODE_PROPERTY, Label.class, null);
        addContainerProperty(SECONDARY_NAMENODE_PROPERTY, Label.class, null);
        addContainerProperty(JOBTRACKER_PROPERTY, Label.class, null);
        addContainerProperty(REPLICATION_PROPERTY, Integer.class, null);

        refreshDataSource();
    }

    public void refreshDataSource() {
        indicator.setVisible(true);
        removeAllItems();

        final Object parentId = addItem(new Object[]{
                "All clusters",
                null,
                null,
                null,
                null,
                null
        });
        List<Config> list = HadoopUI.getHadoopManager().getClusters();
        for (Config cluster : list) {
            Object rowId = addItem(new Object[]{
                    cluster.getClusterName(),
                    cluster.getDomainName(),
                    null,
                    null,
                    null,
                    null
            });
            setParent(parentId, rowId);
        }
        indicator.setVisible(false);
    }
}
{'fraction_non_alphanumeric': 0.08976245532898885, 'fraction_numerical': 0.00588606264452386, 'mean_word_length': 2.4882697947214076, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3962979', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1291, 'n_words': 268}