Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Cache instances of ParsePluginList.

Andrzej Bialeckiea4da6200b79
diff --git a/src/java/org/apache/nutch/parse/ParserFactory.java b/src/java/org/apache/nutch/parse/ParserFactory.java
index 8487f3307..0c877f449 100644
--- a/src/java/org/apache/nutch/parse/ParserFactory.java
+++ b/src/java/org/apache/nutch/parse/ParserFactory.java
@@ -55,7 +55,11 @@ public final class ParserFactory {
this.conf = conf;
this.extensionPoint = PluginRepository.get(conf).getExtensionPoint(
Parser.X_POINT_ID);
- this.parsePluginList = new ParsePluginsReader().parse(conf);
+ this.parsePluginList = (ParsePluginList)conf.getObject(ParsePluginList.class.getName());
+ if (this.parsePluginList == null) {
+ this.parsePluginList = new ParsePluginsReader().parse(conf);
+ conf.setObject(ParsePluginList.class.getName(), this.parsePluginList);
+ }
if (this.extensionPoint == null) {
throw new RuntimeException("x point " + Parser.X_POINT_ID + " not found.");