// 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;
    private long numQuads = 0L;
    private long numDuplicates = 0L;
    private long numMalformed = 0L;
    private long numRdfNodes = 0L;
    private long numRecords = 0L;
    private long n = 0L;
    
    private int tick;

	public Counters (TaskInputOutputContext<?,?,?,?> context) {
		this(context, 1000);
	}

	public Counters (TaskInputOutputContext<?,?,?,?> context, int tick) {
		this.context = context;
		this.tick = tick;

		EventManager.register(this, Constants.eventQuad, this);
		EventManager.register(this, Constants.eventTriple, this);
		EventManager.register(this, Constants.eventDuplicate, this);
		EventManager.register(this, Constants.eventMalformed, this);
		EventManager.register(this, Constants.eventRdfNode, this);
		EventManager.register(this, Constants.eventRecord, this);
	}

	public void setTick(int tick) {
		this.tick = tick;
	}
	
	public int getTick() {
// 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;

    private long numQuads = 0L;
    private long numDuplicates = 0L;
    private long numMalformed = 0L;
    private long numRdfNodes = 0L;
    private long numRecords = 0L;
    private long n = 0L;
    
    private int tick;

	public Counters (TaskInputOutputContext<?,?,?,?> context) {
		this(context, 1000);
	}

	public Counters (TaskInputOutputContext<?,?,?,?> context, int tick) {
		this.context = context;
		this.tick = tick;

		EventManager.register(this, Constants.eventQuad, this);
		EventManager.register(this, Constants.eventTriple, this);
		EventManager.register(this, Constants.eventDuplicate, this);
		EventManager.register(this, Constants.eventMalformed, this);
		EventManager.register(this, Constants.eventRdfNode, this);
		EventManager.register(this, Constants.eventRecord, this);
	}

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