<commit_before>package com.taodian.click.session;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

import com.taodian.api.TaodianApi;
import com.taodian.click.SessionManager;
import com.taodian.click.ShortUrlService;
import com.taodian.emop.Settings;
import com.taodian.emop.utils.CacheApi;
import com.taodian.emop.utils.SimpleCacheApi;

public class HTML5RedisSessionManager implements SessionManager {
	protected Log log = LogFactory.getLog("click.session");

	public static final int DS_COMMON_DATA = 1;

	protected static final String EMOP_COOKIES = "emop_click_uid";
	protected CacheApi newUser = new SimpleCacheApi();
	protected ShortUrlService service = null;
	private JedisPool connPool = null;
	//protected 
	
	public HTML5RedisSessionManager(ShortUrlService s){
		this.service = s;
		
		String host = Settings.getString("redis.host", "127.0.0.1");
		connPool = new JedisPool(new JedisPoolConfig(), host);
	}
	
	@Override
	public String getSessionUserId(HttpServletRequest req,
			HttpServletResponse response) {
		
		String uid = null;<commit_msg>配置Jedis的线程池参数。<commit_after>package com.taodian.click.session;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

import com.taodian.api.TaodianApi;
import com.taodian.click.SessionManager;
import com.taodian.click.ShortUrlService;
import com.taodian.emop.Settings;
import com.taodian.emop.utils.CacheApi;
import com.taodian.emop.utils.SimpleCacheApi;

public class HTML5RedisSessionManager implements SessionManager {
	protected Log log = LogFactory.getLog("click.session");

	public static final int DS_COMMON_DATA = 1;

	protected static final String EMOP_COOKIES = "emop_click_uid";
	protected CacheApi newUser = new SimpleCacheApi();
	protected ShortUrlService service = null;
	private JedisPool connPool = null;
	//protected 
	
	public HTML5RedisSessionManager(ShortUrlService s){
		this.service = s;
		
		String host = Settings.getString("redis.host", "127.0.0.1");
		JedisPoolConfig cfg = new JedisPoolConfig();
		cfg.setMaxWait(1000);
		cfg.setMaxIdle(20);
		cfg.setMaxActive(100);
		connPool = new JedisPool(cfg, host);
	}
	
	@Override
	public String getSessionUserId(HttpServletRequest req,
			HttpServletResponse response) {
		
		String uid = null;
{'fraction_non_alphanumeric': 0.09821717990275526, 'fraction_numerical': 0.008752025931928687, 'mean_word_length': 5.636559139784946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '17347', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1002, 'n_words': 203}