Author: ab Date: Mon Dec 11 02:04:59 2006 New Revision: 485587 URL: http://svn.apache.org/viewvc?view=rev&rev=485587 Log: Remove misplaced cast, which sometimes lead to an overflow.
Close readers when done - when using local FS this would prevent us from deleting temporary dirs. Modified: lucene/nutch/trunk/src/java/org/apache/nutch/crawl/CrawlDbReader.java Modified: lucene/nutch/trunk/src/java/org/apache/nutch/crawl/CrawlDbReader.java URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/java/org/apache/nutch/crawl/CrawlDbReader.java?view=diff&rev=485587&r1=485586&r2=485587 ============================================================================== --- lucene/nutch/trunk/src/java/org/apache/nutch/crawl/CrawlDbReader.java (original) +++ lucene/nutch/trunk/src/java/org/apache/nutch/crawl/CrawlDbReader.java Mon Dec 11 02:04:59 2006 @@ -245,8 +245,6 @@ job.addInputPath(new Path(crawlDb, CrawlDatum.DB_DIR_NAME)); job.setInputFormat(SequenceFileInputFormat.class); - job.setInputKeyClass(Text.class); - job.setInputValueClass(CrawlDatum.class); job.setMapperClass(CrawlDbStatMapper.class); job.setCombinerClass(CrawlDbStatCombiner.class); @@ -286,6 +284,7 @@ val.set(val.get() + value.get()); } } + reader.close(); } if (LOG.isInfoEnabled()) { @@ -302,7 +301,7 @@ } else if (k.equals("scx")) { LOG.info("max score:\t" + (float) (val.get() / 1000.0f)); } else if (k.equals("sct")) { - LOG.info("avg score:\t" + (float) ((float) (val.get() / (float)totalCnt.get()) / 1000.0f)); + LOG.info("avg score:\t" + (float) ((float) (val.get() / totalCnt.get()) / 1000.0f)); } else if (k.startsWith("status")) { int code = Integer.parseInt(k.substring(k.indexOf(' ') + 1)); LOG.info(k + " (" + CrawlDatum.statNames[code] + "):\t" + val);