<commit_before>package org.vanilladb.core.latch;

import java.util.HashMap;
import java.util.Map;

import org.vanilladb.core.latch.feature.LatchFeatureCollector;

public class LatchMgr {
//	private static Logger logger = Logger.getLogger(LatchMgr.class.getName());
	private static final String FEATURE_CSV = "latch-features.csv";
	protected LatchFeatureCollector collector = new LatchFeatureCollector(FEATURE_CSV);

	private Map<String, Latch> latchMap = new HashMap<String, Latch>();

	public static String getKey(String caller, String target, int index) {
		return caller + "-" + target + "-" + index;
	}

	public void startCollecting() {
		collector.startCollecting();
	}

	public ReentrantLatch registerReentrantLatch(String caller, String target, int index) {
		String key = getKey(caller, target, index);
		ReentrantLatch latch = new ReentrantLatch(key, collector);
		latchMap.put(key, latch);
		return latch;
	}

	public ReentrantReadWriteLatch registerReentrantReadWriteLatch(String caller, String target, int index) {
		String key = getKey(caller, target, index);
		ReentrantReadWriteLatch latch = new ReentrantReadWriteLatch(key, collector);
		latchMap.put(key, latch);
		return latch;
	}
}<commit_msg>Change style<commit_after>package org.vanilladb.core.latch;

import java.util.HashMap;
import java.util.Map;

import org.vanilladb.core.latch.feature.LatchFeatureCollector;

public class LatchMgr {
//	private static Logger logger = Logger.getLogger(LatchMgr.class.getName());
	private static final String FEATURE_CSV = "latch-features.csv";

	public static String getKey(String caller, String target, int index) {
		return caller + "-" + target + "-" + index;
	}

	protected LatchFeatureCollector collector = new LatchFeatureCollector(FEATURE_CSV);
	private Map<String, Latch> latchMap = new HashMap<String, Latch>();

	public void startCollecting() {
		collector.startCollecting();
	}

	public ReentrantLatch registerReentrantLatch(String caller, String target, int index) {
		String key = getKey(caller, target, index);
		ReentrantLatch latch = new ReentrantLatch(key, collector);
		latchMap.put(key, latch);
		return latch;
	}

	public ReentrantReadWriteLatch registerReentrantReadWriteLatch(String caller, String target, int index) {
		String key = getKey(caller, target, index);
		ReentrantReadWriteLatch latch = new ReentrantReadWriteLatch(key, collector);
		latchMap.put(key, latch);
		return latch;
	}
}
{'fraction_non_alphanumeric': 0.10152703260420966, 'fraction_numerical': 0.0, 'mean_word_length': 5.622950819672131, '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': '4550396', 'n_tokens_mistral': 812, 'n_tokens_neox': 768, 'n_words': 191}