<commit_before>package eu.socialsensor.graphdatabases;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.common.collect.Iterables;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Index;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;
import com.tinkerpop.blueprints.impls.orient.OrientVertex;
import com.tinkerpop.gremlin.java.GremlinPipeline;

import eu.socialsensor.insert.Insertion;
import eu.socialsensor.insert.OrientMassiveInsertion;
import eu.socialsensor.insert.OrientSingleInsertion;
import eu.socialsensor.query.OrientQuery;
import eu.socialsensor.query.Query;
import eu.socialsensor.utils.Utils;

/**
 * OrientDB graph database implementation
 * 
 * @author sotbeis
 * @email <EMAIL>
 */
public class OrientGraphDatabase implements GraphDatabase{

	private OrientGraph orientGraph = null;
	private OrientGraphNoTx orientGraphNoTx = null;
	private Index<OrientVertex> vetrices = null;
	
	public static void main(String args[]) {
	}	
	
	@Override
	public void open(String dbPAth) {
		orientGraph = new OrientGraph("plocal:"+dbPAth);
		vetrices = orientGraph.getIndex("nodeId", OrientVertex.class);
		
	}
	
	@Override
	public void createGraphForSingleLoad(String dbPath) {
		orientGraph = new OrientGraph("plocal:"+dbPath);
		orientGraph.createIndex("nodeId", OrientVertex.class);
	    vetrices = orientGraph.getIndex("nodeId", OrientVertex.class);
	}
	
	@Override
	public void createGraphForMassiveLoad(String dbPath) {
		OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);
	    OGlobalConfiguration.TX_USE_LOG.setValue(false);
	    OGlobalConfiguration.ENVIRONMENT_CONCURRENT.setValue(false);
	    orientGraphNoTx = new OrientGraphNoTx("plocal:"+dbPath);
	    orientGraphNoTx.createIndex("nodeId", OrientVertex.class);
	    vetrices = orientGraphNoTx.getIndex("nodeId", OrientVertex.class);
	}<commit_msg>minor changes<commit_after>package eu.socialsensor.graphdatabases;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.common.collect.Iterables;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Index;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;
import com.tinkerpop.blueprints.impls.orient.OrientVertex;
import com.tinkerpop.gremlin.java.GremlinPipeline;

import eu.socialsensor.insert.Insertion;
import eu.socialsensor.insert.OrientMassiveInsertion;
import eu.socialsensor.insert.OrientSingleInsertion;
import eu.socialsensor.query.OrientQuery;
import eu.socialsensor.query.Query;
import eu.socialsensor.utils.Utils;

/**
 * OrientDB graph database implementation
 * 
 * @author sotbeis
 * @email <EMAIL>
 */
public class OrientGraphDatabase implements GraphDatabase{

	private OrientGraph orientGraph = null;
	private OrientGraphNoTx orientGraphNoTx = null;
	private Index<OrientVertex> vetrices = null;
	
	public static void main(String args[]) {
	}	
	
	@Override
	public void open(String dbPAth) {
		orientGraph = new OrientGraph("plocal:"+dbPAth);
		vetrices = orientGraph.getIndex("nodeId", OrientVertex.class);
		
	}
	
	@Override
	public void createGraphForSingleLoad(String dbPath) {
		OrientGraphFactory orientGraphFactory = new OrientGraphFactory("plocal:"+dbPath);
		orientGraph = orientGraphFactory.getTx();
		orientGraph.setWarnOnForceClosingTx(false);
		//maybe use keyIndex for unique ids?
		vetrices = orientGraph.createIndex("nodeId", OrientVertex.class);
		orientGraph.setWarnOnForceClosingTx(false);
	}
	
	@Override
	public void createGraphForMassiveLoad(String dbPath) {
		OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);
	    OGlobalConfiguration.TX_USE_LOG.setValue(false);
	    OGlobalConfiguration.ENVIRONMENT_CONCURRENT.setValue(false);
	    orientGraphNoTx = new OrientGraphNoTx("plocal:"+dbPath);
	    orientGraphNoTx.createIndex("nodeId", OrientVertex.class);
	    vetrices = orientGraphNoTx.getIndex("nodeId", OrientVertex.class);
	}
{'fraction_non_alphanumeric': 0.10082572794437202, 'fraction_numerical': 0.0, 'mean_word_length': 6.180967238689548, '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': '255017', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1416, 'n_words': 248}