<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.safehaus.kiskis.mgmt.ui.pig.wizard;

import com.google.common.base.Strings;
import com.vaadin.data.Property;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.*;
import org.safehaus.kiskis.mgmt.api.hadoop.Config;
import org.safehaus.kiskis.mgmt.shared.protocol.Agent;
import org.safehaus.kiskis.mgmt.shared.protocol.Util;
import org.safehaus.kiskis.mgmt.ui.pig.PigUI;

import java.util.*;

/**
 * @author dilshat
 */
public class ConfigurationStep extends Panel {

    private final TwinColSelect select;

    public ConfigurationStep(final Wizard wizard) {

        setSizeFull();

        GridLayout content = new GridLayout(1, 2);
        content.setSizeFull();
        content.setSpacing(true);
        content.setMargin(true);

        ComboBox hadoopClusters = new ComboBox("Hadoop cluster");
        select = new TwinColSelect("Nodes", new ArrayList<Agent>());

        hadoopClusters.setMultiSelect(false);
        hadoopClusters.setImmediate(true);
        hadoopClusters.setTextInputAllowed(false);
        hadoopClusters.setRequired(true);
        hadoopClusters.setNullSelectionAllowed(false);

        List<Config> clusters = PigUI.getHadoopManager().getClusters();
        if (clusters.size() > 0) {
            for (Config hadoopClusterInfo : clusters) {
                hadoopClusters.addItem(hadoopClusterInfo);
                hadoopClusters.setItemCaption(hadoopClusterInfo,
                        hadoopClusterInfo.getClusterName());
            }
        }

        Config info = PigUI.getHadoopManager().getCluster(wizard.getConfig().getClusterName());

        if (info != null) {
            hadoopClusters.setValue(info);
        } else if (clusters.size() > 0) {
            hadoopClusters.setValue(clusters.iterator().next());
        }

        if (hadoopClusters.getValue() != null) {<commit_msg>Minor bugfix<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.safehaus.kiskis.mgmt.ui.pig.wizard;

import com.google.common.base.Strings;
import com.vaadin.data.Property;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.*;
import org.safehaus.kiskis.mgmt.api.hadoop.Config;
import org.safehaus.kiskis.mgmt.shared.protocol.Agent;
import org.safehaus.kiskis.mgmt.shared.protocol.Util;
import org.safehaus.kiskis.mgmt.ui.pig.PigUI;

import java.util.*;

/**
 * @author dilshat
 */
public class ConfigurationStep extends Panel {

    private final TwinColSelect select;

    public ConfigurationStep(final Wizard wizard) {

        setSizeFull();

        GridLayout content = new GridLayout(1, 3);
        content.setSizeFull();
        content.setSpacing(true);
        content.setMargin(true);

        ComboBox hadoopClusters = new ComboBox("Hadoop cluster");
        select = new TwinColSelect("Nodes", new ArrayList<Agent>());

        hadoopClusters.setMultiSelect(false);
        hadoopClusters.setImmediate(true);
        hadoopClusters.setTextInputAllowed(false);
        hadoopClusters.setRequired(true);
        hadoopClusters.setNullSelectionAllowed(false);

        List<Config> clusters = PigUI.getHadoopManager().getClusters();
        if (clusters.size() > 0) {
            for (Config hadoopClusterInfo : clusters) {
                hadoopClusters.addItem(hadoopClusterInfo);
                hadoopClusters.setItemCaption(hadoopClusterInfo,
                        hadoopClusterInfo.getClusterName());
            }
        }

        Config info = PigUI.getHadoopManager().getCluster(wizard.getConfig().getClusterName());

        if (info != null) {
            hadoopClusters.setValue(info);
        } else if (clusters.size() > 0) {
            hadoopClusters.setValue(clusters.iterator().next());
        }

        if (hadoopClusters.getValue() != null) {
{'fraction_non_alphanumeric': 0.11039426523297491, 'fraction_numerical': 0.0019115890083632018, 'mean_word_length': 3.0640776699029124, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '382831', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1183, 'n_words': 233}