protected void loadScorefile(int numDocs, String inputFile, final int column) { logger.info("Opening listofscores feature file " + inputFile); try { staticScores = new double[numDocs]; BufferedReader br = Files.openFileReader(inputFile); String line = null; int i=0; TerrierTimer tt = new TerrierTimer("Loading score file", numDocs); tt.start(); while((line = br.readLine()) != null) { String[] parts = SPLIT_SPACE.split(line, column+1); staticScores[i++] = Double.parseDouble(parts[column -1]); tt.increment(); } tt.finished(); br.close(); } catch (Exception e) { logger.error("Problem opening file: \""+inputFile+"\"", e); } }
@Override public void run() { //System.err.println("Thread started"); while(done < total) { //System.err.println("pctg == " + getPercentage()); final short pctg = getPercentage(); if (pctg != lastPercentage) { if (pctg > 0) logger.info(message + " "+ pctg + "% done. Estimated finished in " + getRemainingTime()); lastPercentage = pctg; } try { Thread.sleep(1000); } catch (InterruptedException e) { } } }
public static void main(String[] args) throws Exception { TerrierTimer tt = new TerrierTimer("TestTimer", 3); tt.start(); Thread.sleep(2000); tt.increment(); Thread.sleep(2000); tt.increment(); tt.increment(); }
protected void loadScorefile(int numDocs, String inputFile, final int column) { logger.info("Opening listofscores feature file " + inputFile); try { staticScores = new double[numDocs]; BufferedReader br = Files.openFileReader(inputFile); String line = null; int i=0; TerrierTimer tt = new TerrierTimer("Loading score file", numDocs); tt.start(); while((line = br.readLine()) != null) { String[] parts = SPLIT_SPACE.split(line, column+1); staticScores[i++] = Double.parseDouble(parts[column -1]); tt.increment(); } tt.finished(); br.close(); } catch (Exception e) { logger.error("Problem opening file: \""+inputFile+"\"", e); } }
@Override public void run() { //System.err.println("Thread started"); while(done < total) { //System.err.println("pctg == " + getPercentage()); final short pctg = getPercentage(); if (pctg != lastPercentage) { if (pctg > 0) logger.info(message + " "+ pctg + "% done. Estimated finished in " + getRemainingTime()); lastPercentage = pctg; } try { Thread.sleep(1000); } catch (InterruptedException e) { } } }
protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document lengths", this.size());tt.start(); while(iter.hasNext()) { docLengths[i++] = iter.next().getDocumentLength(); tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document lengths", this.size());tt.start(); while(iter.hasNext()) { docLengths[i++] = iter.next().getDocumentLength(); tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
@Override protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document + field lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; fieldLengths = new int[this.size()][]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document + field lengths", this.size());tt.start(); while(iter.hasNext()) { FieldDocumentIndexEntry fdie = (FieldDocumentIndexEntry)iter.next(); docLengths[i] = fdie.getDocumentLength(); fieldLengths[i] = fdie.getFieldLengths(); i++; tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
@Override protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document + field lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; fieldLengths = new int[this.size()][]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document + field lengths", this.size());tt.start(); while(iter.hasNext()) { FieldDocumentIndexEntry fdie = (FieldDocumentIndexEntry)iter.next(); docLengths[i] = fdie.getDocumentLength(); fieldLengths[i] = fdie.getFieldLengths(); i++; tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
valueFactoryClass); TerrierTimer tt = new TerrierTimer("Recompressing inverted index", index.getCollectionStatistics().getNumberOfPointers()); tt.start(); try{ tt.increment(); tt.finished(); icpw.close(); IndexUtil.close(iterator);
valueFactoryClass); TerrierTimer tt = new TerrierTimer("Recompressing inverted index", index.getCollectionStatistics().getNumberOfPointers()); tt.start(); try{ tt.increment(); tt.finished(); icpw.close(); IndexUtil.close(iterator);
Iterator<String[]> metaIn = (Iterator<String[]>) index.getIndexStructureInputStream("meta"); int docid = 0; TerrierTimer tt = new TerrierTimer("Reading metaindex", index.getCollectionStatistics().getNumberOfDocuments()); tt.start(); try{ while(metaIn.hasNext()) tt.increment(); tt.finished();
Iterator<String[]> metaIn = (Iterator<String[]>) index.getIndexStructureInputStream("meta"); int docid = 0; TerrierTimer tt = new TerrierTimer("Reading metaindex", index.getCollectionStatistics().getNumberOfDocuments()); tt.start(); try{ while(metaIn.hasNext()) tt.increment(); tt.finished();
int[] fieldFs = null; TerrierTimer tt = new TerrierTimer("Inverted index processing for this iteration", index.getCollectionStatistics().getNumberOfPointers()); tt.start(); try{ while(iiis.hasNext()) tt.increment(numPostingsForTerm); tt.finished();
int[] fieldFs = null; TerrierTimer tt = new TerrierTimer("Inverted index processing for this iteration", index.getCollectionStatistics().getNumberOfPointers()); tt.start(); try{ while(iiis.hasNext()) tt.increment(numPostingsForTerm); tt.finished();