<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.telefonica.tcloud.mysql_monpersistence;

import com.telefonica.tcloud.collectorinterfaces.MonPersistence;
import com.telefonica.tcloud.collectorinterfaces.MonPersistenceFactory;
import com.telefonica.tcloud.jdbc_monpersistence.JDBC_MonPersistence;
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author jomar
 */
public class MySQL_MonPersistenceFactory extends MonPersistenceFactory {
    public static final String driver="com.mysql.jdbc.Driver";
    
    @Override
    public MonPersistence getPersistence(LinkedHashMap<String, String[]> config) {
        try {
            System.out.println(config.get("mysqlurl")[0]+
                    config.get("mysqluser")[0]+
                    config.get("mysqlpassword")[0]);
                    
            return new JDBC_MonPersistence(config.get("mysqlurl")[0],
                    config.get("mysqluser")[0],
                    config.get("mysqlpassword")[0], driver);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(MySQL_MonPersistenceFactory.class.getName()).log(Level.SEVERE, null, ex);<commit_msg>MySQLMonPersistenceFactory must return MySQLMonPersistence, not JDBCMonPersistence<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.telefonica.tcloud.mysql_monpersistence;

import com.telefonica.tcloud.collectorinterfaces.MonPersistence;
import com.telefonica.tcloud.collectorinterfaces.MonPersistenceFactory;
import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author jomar
 */
public class MySQL_MonPersistenceFactory extends MonPersistenceFactory {
    
    @Override
    public MonPersistence getPersistence(LinkedHashMap<String, String[]> config) {
        try {
            System.out.println(config.get("mysqlurl")[0]+
                    config.get("mysqluser")[0]+
                    config.get("mysqlpassword")[0]);
                    
            return new MySQL_MonPersistence(config.get("mysqlurl")[0],
                    config.get("mysqluser")[0],
                    config.get("mysqlpassword")[0]);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(MySQL_MonPersistenceFactory.class.getName()).log(Level.SEVERE, null, ex);
{'fraction_non_alphanumeric': 0.10896170548756415, 'fraction_numerical': 0.00473746545598105, 'mean_word_length': 3.302207130730051, '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': '7255754', 'n_tokens_mistral': 718, 'n_tokens_neox': 705, 'n_words': 126}