Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Remove remaining calls to static NutchConf.get() in favor of using per-instance local configuration getConf().

Andrzej Bialeckibf560b191a49
diff --git a/src/java/org/apache/nutch/crawl/Fetcher.java b/src/java/org/apache/nutch/crawl/Fetcher.java
index 7641427e5..89c7ab15f 100644
--- a/src/java/org/apache/nutch/crawl/Fetcher.java
+++ b/src/java/org/apache/nutch/crawl/Fetcher.java
@@ -288,7 +288,7 @@ public class Fetcher extends NutchConfigured implements MapRunnable {
}
// select a timeout that avoids a task timeout
- long timeout = NutchConf.get().getInt("mapred.task.timeout", 10*60*1000)/2;
+ long timeout = getConf().getInt("mapred.task.timeout", 10*60*1000)/2;
do { // wait for threads to exit
try {
diff --git a/src/java/org/apache/nutch/crawl/Generator.java b/src/java/org/apache/nutch/crawl/Generator.java
index 0a20198db..d06f0b857 100644
--- a/src/java/org/apache/nutch/crawl/Generator.java
+++ b/src/java/org/apache/nutch/crawl/Generator.java
@@ -159,7 +159,7 @@ public class Generator extends NutchConfigured {
throws IOException {
File tempDir =
- new File(NutchConf.get().get("mapred.temp.dir", ".") +
+ new File(getConf().get("mapred.temp.dir", ".") +
"/generate-temp-"+
Integer.toString(new Random().nextInt(Integer.MAX_VALUE)));
diff --git a/src/java/org/apache/nutch/crawl/Injector.java b/src/java/org/apache/nutch/crawl/Injector.java
index 83dbe1ace..cfaff74f3 100644
--- a/src/java/org/apache/nutch/crawl/Injector.java
+++ b/src/java/org/apache/nutch/crawl/Injector.java
@@ -84,7 +84,7 @@ public class Injector extends NutchConfigured {
LOG.info("Injector: urlDir: " + urlDir);
File tempDir =
- new File(NutchConf.get().get("mapred.temp.dir", ".") +
+ new File(getConf().get("mapred.temp.dir", ".") +
"/inject-temp-"+
Integer.toString(new Random().nextInt(Integer.MAX_VALUE)));