Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-2616 Review routing of deletions by Exchange component - send deletions to all index writers

Sebastian Nagel718f51bf185e
diff --git a/src/java/org/apache/nutch/indexer/IndexWriters.java b/src/java/org/apache/nutch/indexer/IndexWriters.java
index db37d62f1..3ac20bfea 100644
--- a/src/java/org/apache/nutch/indexer/IndexWriters.java
+++ b/src/java/org/apache/nutch/indexer/IndexWriters.java
@@ -18,7 +18,6 @@ package org.apache.nutch.indexer;
import org.apache.hadoop.conf.Configuration;
import org.apache.nutch.exchange.Exchanges;
-import org.apache.nutch.metadata.Nutch;
import org.apache.nutch.plugin.Extension;
import org.apache.nutch.plugin.ExtensionPoint;
import org.apache.nutch.plugin.PluginRepository;
@@ -233,14 +232,10 @@ public class IndexWriters {
}
}
- public void delete(String key, NutchDocument doc) throws IOException {
- for (String indexWriterId : getIndexWriters(doc)) {
- this.indexWriters.get(indexWriterId).getIndexWriter().delete(key);
- }
- }
-
public void delete(String key) throws IOException {
-
+ for (IndexWriterWrapper iww : indexWriters.values()) {
+ iww.getIndexWriter().delete(key);
+ }
}
public void close() throws IOException {
diff --git a/src/java/org/apache/nutch/indexer/IndexerOutputFormat.java b/src/java/org/apache/nutch/indexer/IndexerOutputFormat.java
index 1837e1fcd..3ce4f8061 100644
--- a/src/java/org/apache/nutch/indexer/IndexerOutputFormat.java
+++ b/src/java/org/apache/nutch/indexer/IndexerOutputFormat.java
@@ -54,7 +54,7 @@ public class IndexerOutputFormat
if (indexAction.action == NutchIndexAction.ADD) {
writers.write(indexAction.doc);
} else if (indexAction.action == NutchIndexAction.DELETE) {
- writers.delete(key.toString(), indexAction.doc);
+ writers.delete(key.toString());
}
}
};