<commit_before>package org.safehaus.subutai.impl.accumulo.handler;


import java.util.UUID;

import org.safehaus.subutai.api.accumulo.Config;
import org.safehaus.subutai.api.commandrunner.AgentResult;
import org.safehaus.subutai.api.commandrunner.Command;
import org.safehaus.subutai.api.dbmanager.DBException;
import org.safehaus.subutai.impl.accumulo.AccumuloImpl;
import org.safehaus.subutai.impl.accumulo.Commands;
import org.safehaus.subutai.shared.operation.AbstractOperationHandler;
import org.safehaus.subutai.shared.operation.ProductOperation;
import org.safehaus.subutai.shared.protocol.Agent;
import org.safehaus.subutai.shared.protocol.Util;

import com.google.common.base.Strings;


/**
 * Created by dilshat on 5/6/14.
 */
public class InstallOperationHandler extends AbstractOperationHandler<AccumuloImpl> {
    private final Config config;
    private final ProductOperation po;


    public InstallOperationHandler( AccumuloImpl manager, Config config ) {
        super( manager, config.getClusterName() );
        this.config = config;
        po = manager.getTracker()
                    .createProductOperation( Config.PRODUCT_KEY, String.format( "Installing %s", Config.PRODUCT_KEY ) );
    }


    @Override
    public UUID getTrackerId() {
        return po.getId();
    }


    @Override
    public void run() {
        if ( config.getMasterNode() == null || config.getGcNode() == null || config.getMonitor() == null || Strings
                .isNullOrEmpty( config.getClusterName() ) || Util.isCollectionEmpty( config.getTracers() ) || Util
                .isCollectionEmpty( config.getSlaves() ) ) {
            po.addLogFailed( "Malformed configuration\nInstallation aborted" );
            return;
        }

        if ( config.getMasterNode().equals( config.getGcNode() ) ) {
            po.addLogFailed( "Master and CG can not be the same node" );
            return;
        }

        if ( manager.getCluster( config.getClusterName() ) != null ) {<commit_msg>Preparations for acceptance tests<commit_after>package org.safehaus.subutai.impl.accumulo.handler;


import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.safehaus.subutai.api.accumulo.Config;
import org.safehaus.subutai.api.commandrunner.AgentResult;
import org.safehaus.subutai.api.commandrunner.Command;
import org.safehaus.subutai.api.dbmanager.DBException;
import org.safehaus.subutai.impl.accumulo.AccumuloImpl;
import org.safehaus.subutai.impl.accumulo.Commands;
import org.safehaus.subutai.shared.operation.AbstractOperationHandler;
import org.safehaus.subutai.shared.operation.ProductOperation;
import org.safehaus.subutai.shared.protocol.Agent;
import org.safehaus.subutai.shared.protocol.Util;

import com.google.common.base.Strings;


/**
 * Created by dilshat on 5/6/14.
 */
public class InstallOperationHandler extends AbstractOperationHandler<AccumuloImpl> {
    private final Config config;
    private final ProductOperation po;


    public InstallOperationHandler( AccumuloImpl manager, Config config ) {
        super( manager, config.getClusterName() );
        this.config = config;
        po = manager.getTracker()
                    .createProductOperation( Config.PRODUCT_KEY, String.format( "Installing %s", Config.PRODUCT_KEY ) );
    }


    @Override
    public UUID getTrackerId() {
        return po.getId();
    }


    @Override
    public void run() {

        Logger LOG = Logger.getLogger( InstallOperationHandler.class.getName() );

        LOG.log( Level.WARNING, config.toString() );

        if ( config.getMasterNode() == null || config.getGcNode() == null || config.getMonitor() == null || Strings
                .isNullOrEmpty( config.getClusterName() ) || Util.isCollectionEmpty( config.getTracers() ) || Util
                .isCollectionEmpty( config.getSlaves() ) ) {
            po.addLogFailed( "Malformed configuration\nInstallation aborted" );
            return;
        }

        if ( config.getMasterNode().equals( config.getGcNode() ) ) {
            po.addLogFailed( "Master and CG can not be the same node" );
            return;
        }

        if ( manager.getCluster( config.getClusterName() ) != null ) {
{'fraction_non_alphanumeric': 0.11203417991929741, 'fraction_numerical': 0.0018988844054118206, 'mean_word_length': 3.286876907426246, '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': '1096170', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1219, 'n_words': 236}