You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by cu...@apache.org on 2005/09/15 20:11:41 UTC
svn commit: r289286 -
/lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java
Author: cutting
Date: Thu Sep 15 11:11:39 2005
New Revision: 289286
URL: http://svn.apache.org/viewcvs?rev=289286&view=rev
Log:
Don't synchronize while making setStatus() RPC.
Modified:
lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java
Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java?rev=289286&r1=289285&r2=289286&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/crawl/Fetcher.java Thu Sep 15 11:11:39 2005
@@ -234,12 +234,16 @@
bytes += bytesInPage;
}
- private synchronized void reportStatus() throws IOException {
- long elapsed = (System.currentTimeMillis() - start)/1000;
- reporter.setStatus
- (pages+" pages, "+errors+" errors, "
- + Math.round(((float)pages*10)/elapsed)/10.0+" pages/s, "
- + Math.round(((((float)bytes)*8)/1024)/elapsed)+" kb/s, ");
+ private void reportStatus() throws IOException {
+ String status;
+ synchronized (this) {
+ long elapsed = (System.currentTimeMillis() - start)/1000;
+ status =
+ pages+" pages, "+errors+" errors, "
+ + Math.round(((float)pages*10)/elapsed)/10.0+" pages/s, "
+ + Math.round(((((float)bytes)*8)/1024)/elapsed)+" kb/s, ";
+ }
+ reporter.setStatus(status);
}
public void configure(JobConf job) {