<commit_before>package com.github.diegopacheco.dynomite.cluster.checker.cluster.cache;

import java.util.concurrent.TimeUnit;

import javax.inject.Singleton;

import com.github.diegopacheco.dynomite.cluster.checker.cluster.DCCConnectionManager;
import com.github.diegopacheco.dynomite.cluster.checker.parser.DynomiteNodeInfo;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;
import com.google.common.cache.RemovalNotification;
import com.netflix.dyno.jedis.DynoJedisClient;

@Singleton
public class ClientCache {

	private static Cache<String, DynoJedisClient> cache;

	static {
		cache =  CacheBuilder.newBuilder().
				  maximumSize(500).
				  expireAfterWrite(2, TimeUnit.HOURS).
				  removalListener(new RemovalListener<String, DynoJedisClient>(){
						@Override<commit_msg>Change TTL to be on READ not on WRITE anymore<commit_after>package com.github.diegopacheco.dynomite.cluster.checker.cluster.cache;

import java.util.concurrent.TimeUnit;

import javax.inject.Singleton;

import com.github.diegopacheco.dynomite.cluster.checker.cluster.DCCConnectionManager;
import com.github.diegopacheco.dynomite.cluster.checker.parser.DynomiteNodeInfo;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;
import com.google.common.cache.RemovalNotification;
import com.netflix.dyno.jedis.DynoJedisClient;

@Singleton
public class ClientCache {

	private static Cache<String, DynoJedisClient> cache;

	static {
		cache =  CacheBuilder.newBuilder().
				  maximumSize(500).
				  expireAfterAccess(2, TimeUnit.HOURS).
				  removalListener(new RemovalListener<String, DynoJedisClient>(){
						@Override
{'fraction_non_alphanumeric': 0.09891984081864696, 'fraction_numerical': 0.0045480386583285955, 'mean_word_length': 5.666666666666667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3027207', 'n_tokens_mistral': 612, 'n_tokens_neox': 565, 'n_words': 86}