<commit_before>package com.outbrain.ob1k.db;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

import com.outbrain.swinfra.metrics.api.MetricFactory;
import scala.Option;
import scala.collection.Iterator;
import scala.collection.JavaConversions;

import com.github.mauricio.async.db.QueryResult;
import com.github.mauricio.async.db.ResultSet;
import com.github.mauricio.async.db.RowData;
import com.google.common.base.Joiner;
import com.outbrain.ob1k.concurrent.ComposableFuture;
import com.outbrain.ob1k.concurrent.handlers.FutureSuccessHandler;
import com.outbrain.ob1k.concurrent.handlers.SuccessHandler;

/**
 * User: aronen
 * Date: 9/22/13
 * Time: 4:15 PM
 */
public class BasicDao {
    private final MySqlConnectionPool _pool;

    public BasicDao(final MySqlConnectionPool pool) {
        this._pool = pool;
    }

    /**
     * Warning - Use only when the connection string is in host:port format without schema and other parameter.
     * example: devdb.il.outbrain.com:3308
     *
     * @param connectionString - host:port
     * @param database         the database schema name.
     * @param userName         user name for login.
     * @param password         password for login.
     */
    public BasicDao(final String connectionString, final String database, final String userName, final String password, final MetricFactory metricFactory) {
        final String[] arr = connectionString.split(":");
        final String host = arr[0];
        final int port = Integer.parseInt(arr[1]);
        _pool = new MySqlConnectionPool(host, port, database, userName, password, metricFactory);
    }

    public BasicDao(final String connectionString, final String database, final String userName, final String password) {
        this(connectionString, database, userName, password, null);<commit_msg>javadoc enhancement<commit_after>package com.outbrain.ob1k.db;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

import com.outbrain.swinfra.metrics.api.MetricFactory;
import scala.Option;
import scala.collection.Iterator;
import scala.collection.JavaConversions;

import com.github.mauricio.async.db.QueryResult;
import com.github.mauricio.async.db.ResultSet;
import com.github.mauricio.async.db.RowData;
import com.google.common.base.Joiner;
import com.outbrain.ob1k.concurrent.ComposableFuture;
import com.outbrain.ob1k.concurrent.handlers.FutureSuccessHandler;
import com.outbrain.ob1k.concurrent.handlers.SuccessHandler;

/**
 * User: aronen
 * Date: 9/22/13
 * Time: 4:15 PM
 */
public class BasicDao {
    private final MySqlConnectionPool _pool;

    public BasicDao(final MySqlConnectionPool pool) {
        this._pool = pool;
    }

    /**
     * Warning - Use only when the connection string is in host:port format without schema and other parameter.
     * example: mydb.company.com:3308
     *
     * @param connectionString - host:port
     * @param database         the database schema name.
     * @param userName         user name for login.
     * @param password         password for login.
     */
    public BasicDao(final String connectionString, final String database, final String userName, final String password, final MetricFactory metricFactory) {
        final String[] arr = connectionString.split(":");
        final String host = arr[0];
        final int port = Integer.parseInt(arr[1]);
        _pool = new MySqlConnectionPool(host, port, database, userName, password, metricFactory);
    }

    public BasicDao(final String connectionString, final String database, final String userName, final String password) {
        this(connectionString, database, userName, password, null);
{'fraction_non_alphanumeric': 0.0938562091503268, 'fraction_numerical': 0.009411764705882352, 'mean_word_length': 3.8005018820577163, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '674173', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1081, 'n_words': 292}