// Path: src/main/java/org/apache/jena/grande/Constants.java
// public class Constants {
// 
// 	public static final String RUN_ID = "runId";
// 
// 	public static final String OPTION_USE_COMPRESSION = "useCompression";
// 	public static final boolean OPTION_USE_COMPRESSION_DEFAULT = false;
// 
// 	public static final String OPTION_OVERWRITE_OUTPUT = "overwriteOutput";
// 	public static final boolean OPTION_OVERWRITE_OUTPUT_DEFAULT = false;
// 
// 	public static final String OPTION_RUN_LOCAL = "runLocal";
// 	public static final boolean OPTION_RUN_LOCAL_DEFAULT = false;
// 
// 	public static final String OPTION_NUM_REDUCERS = "numReducers";
// 	public static final int OPTION_NUM_REDUCERS_DEFAULT = 20;
// 	
// 	public static final String RDF_2_ADJACENCY_LIST = "rdf2adjacencylist";
// 
// 
// 	public static final PrefixMap defaultPrefixMap = new PrefixMap();
// 	static {
// 		defaultPrefixMap.add("rdf", RDF.getURI());
// 		defaultPrefixMap.add("rdfs", RDFS.getURI());
// 		defaultPrefixMap.add("owl", OWL.getURI());
// 		defaultPrefixMap.add("xsd", XSD.getURI());
// 		defaultPrefixMap.add("foaf", FOAF.getURI());
// 		defaultPrefixMap.add("dc", DC.getURI());
// 		defaultPrefixMap.add("dcterms", DCTerms.getURI());
// 		defaultPrefixMap.add("dctypes", DCTypes.getURI());
// 	}
// 
// 	// MapReduce counters
// 	
// 	public static final String JENA_GRANDE_COUNTER_GROUPNAME = "TDBLoader4 Counters";
// 	public static final String JENA_GRANDE_COUNTER_MALFORMED = "Malformed";
// 	public static final String JENA_GRANDE_COUNTER_QUADS = "Quads (including duplicates)";
// 	public static final String JENA_GRANDE_COUNTER_TRIPLES = "Triples (including duplicates)";
// 	public static final String JENA_GRANDE_COUNTER_DUPLICATES = "Duplicates (quads or triples)";
// 	public static final String JENA_GRANDE_COUNTER_RDFNODES = "RDF nodes";
// 	public static final String JENA_GRANDE_COUNTER_RECORDS = "Index records";
// 	
// 	// Event types
// 	
// 	public static EventType eventQuad = new EventType("quad");
// 	public static EventType eventTriple = new EventType("triple");
// 	public static EventType eventDuplicate = new EventType("duplicate");
// 	public static EventType eventMalformed = new EventType("malformed");
// 	public static EventType eventRdfNode = new EventType("RDF node");
// 	public static EventType eventRecord = new EventType("record");
// 	public static EventType eventTick = new EventType("tick");
// 	
// }
// 
// Path: src/main/java/org/apache/jena/grande/JenaGrandeException.java
// @SuppressWarnings("serial")
// public class JenaGrandeException extends JenaException {
// 
//     public JenaGrandeException()                          { super() ; }
//     public JenaGrandeException(String msg)                { super(msg) ; }
//     public JenaGrandeException(Throwable th)              { super(th) ; }
//     public JenaGrandeException(String msg, Throwable th)  { super(msg, th) ; }
// 
// }


import org.apache.hadoop.mapreduce.Counter;
import org.apache.hadoop.mapreduce.TaskInputOutputContext;
import org.apache.jena.grande.Constants;
import org.apache.jena.grande.JenaGrandeException;
import org.openjena.atlas.event.Event;
import org.openjena.atlas.event.EventListener;
import org.openjena.atlas.event.EventManager;
import org.openjena.atlas.event.EventType;
		this.tick = tick;
	}
	
	public int getTick() {
		return tick;
	}

	@Override
	public void event(Object dest, Event event) {
		if ( this.equals(dest) ) {
			EventType type = event.getType();
			if ( type.equals(Constants.eventQuad) ) {
				if ( counterQuads == null ) counterQuads = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_QUADS);
				numQuads++;
			} else if ( type.equals(Constants.eventTriple) ) {
				if ( counterTriples == null ) counterTriples = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_TRIPLES);
				numTriples++;
			} else if ( type.equals(Constants.eventDuplicate) ) {
				if ( counterDuplicates == null ) counterDuplicates = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_DUPLICATES);
				numDuplicates++;
			} else if ( type.equals(Constants.eventMalformed) ) {
				if ( counterMalformed == null ) counterMalformed = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_MALFORMED);
				numMalformed++;
			} else if ( type.equals(Constants.eventRdfNode) ) {
				if ( counterRdfNodes == null ) counterRdfNodes = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_RDFNODES);
				numRdfNodes++;
			} else if ( type.equals(Constants.eventRecord) ) {
				if ( counterRecords == null ) counterRecords = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_RECORDS);
				numRecords++;
			} else {
// Path: src/main/java/org/apache/jena/grande/Constants.java
// public class Constants {
// 
// 	public static final String RUN_ID = "runId";
// 
// 	public static final String OPTION_USE_COMPRESSION = "useCompression";
// 	public static final boolean OPTION_USE_COMPRESSION_DEFAULT = false;
// 
// 	public static final String OPTION_OVERWRITE_OUTPUT = "overwriteOutput";
// 	public static final boolean OPTION_OVERWRITE_OUTPUT_DEFAULT = false;
// 
// 	public static final String OPTION_RUN_LOCAL = "runLocal";
// 	public static final boolean OPTION_RUN_LOCAL_DEFAULT = false;
// 
// 	public static final String OPTION_NUM_REDUCERS = "numReducers";
// 	public static final int OPTION_NUM_REDUCERS_DEFAULT = 20;
// 	
// 	public static final String RDF_2_ADJACENCY_LIST = "rdf2adjacencylist";
// 
// 
// 	public static final PrefixMap defaultPrefixMap = new PrefixMap();
// 	static {
// 		defaultPrefixMap.add("rdf", RDF.getURI());
// 		defaultPrefixMap.add("rdfs", RDFS.getURI());
// 		defaultPrefixMap.add("owl", OWL.getURI());
// 		defaultPrefixMap.add("xsd", XSD.getURI());
// 		defaultPrefixMap.add("foaf", FOAF.getURI());
// 		defaultPrefixMap.add("dc", DC.getURI());
// 		defaultPrefixMap.add("dcterms", DCTerms.getURI());
// 		defaultPrefixMap.add("dctypes", DCTypes.getURI());
// 	}
// 
// 	// MapReduce counters
// 	
// 	public static final String JENA_GRANDE_COUNTER_GROUPNAME = "TDBLoader4 Counters";
// 	public static final String JENA_GRANDE_COUNTER_MALFORMED = "Malformed";
// 	public static final String JENA_GRANDE_COUNTER_QUADS = "Quads (including duplicates)";
// 	public static final String JENA_GRANDE_COUNTER_TRIPLES = "Triples (including duplicates)";
// 	public static final String JENA_GRANDE_COUNTER_DUPLICATES = "Duplicates (quads or triples)";
// 	public static final String JENA_GRANDE_COUNTER_RDFNODES = "RDF nodes";
// 	public static final String JENA_GRANDE_COUNTER_RECORDS = "Index records";
// 	
// 	// Event types
// 	
// 	public static EventType eventQuad = new EventType("quad");
// 	public static EventType eventTriple = new EventType("triple");
// 	public static EventType eventDuplicate = new EventType("duplicate");
// 	public static EventType eventMalformed = new EventType("malformed");
// 	public static EventType eventRdfNode = new EventType("RDF node");
// 	public static EventType eventRecord = new EventType("record");
// 	public static EventType eventTick = new EventType("tick");
// 	
// }
// 
// Path: src/main/java/org/apache/jena/grande/JenaGrandeException.java
// @SuppressWarnings("serial")
// public class JenaGrandeException extends JenaException {
// 
//     public JenaGrandeException()                          { super() ; }
//     public JenaGrandeException(String msg)                { super(msg) ; }
//     public JenaGrandeException(Throwable th)              { super(th) ; }
//     public JenaGrandeException(String msg, Throwable th)  { super(msg, th) ; }
// 
// }


// Path: src/main/java/org/apache/jena/grande/mapreduce/Counters.java
import org.apache.hadoop.mapreduce.Counter;
import org.apache.hadoop.mapreduce.TaskInputOutputContext;
import org.apache.jena.grande.Constants;
import org.apache.jena.grande.JenaGrandeException;
import org.openjena.atlas.event.Event;
import org.openjena.atlas.event.EventListener;
import org.openjena.atlas.event.EventManager;
import org.openjena.atlas.event.EventType;

		this.tick = tick;
	}
	
	public int getTick() {
		return tick;
	}

	@Override
	public void event(Object dest, Event event) {
		if ( this.equals(dest) ) {
			EventType type = event.getType();
			if ( type.equals(Constants.eventQuad) ) {
				if ( counterQuads == null ) counterQuads = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_QUADS);
				numQuads++;
			} else if ( type.equals(Constants.eventTriple) ) {
				if ( counterTriples == null ) counterTriples = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_TRIPLES);
				numTriples++;
			} else if ( type.equals(Constants.eventDuplicate) ) {
				if ( counterDuplicates == null ) counterDuplicates = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_DUPLICATES);
				numDuplicates++;
			} else if ( type.equals(Constants.eventMalformed) ) {
				if ( counterMalformed == null ) counterMalformed = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_MALFORMED);
				numMalformed++;
			} else if ( type.equals(Constants.eventRdfNode) ) {
				if ( counterRdfNodes == null ) counterRdfNodes = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_RDFNODES);
				numRdfNodes++;
			} else if ( type.equals(Constants.eventRecord) ) {
				if ( counterRecords == null ) counterRecords = context.getCounter(Constants.JENA_GRANDE_COUNTER_GROUPNAME, Constants.JENA_GRANDE_COUNTER_RECORDS);
				numRecords++;
			} else {
				throw new JenaGrandeException("Unsupported event type: " + type);