Skip to content

Commit

Permalink
Merge pull request #363 from sebastian-nagel/NUTCH-2616-exchange-rout…
Browse files Browse the repository at this point in the history
…e-deletions

NUTCH-2616 Review routing of deletions by Exchange component
  • Loading branch information
sebastian-nagel committed Jul 19, 2018
2 parents f263d91 + 718f51b commit 2999e14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/java/org/apache/nutch/indexer/IndexWriters.java
Expand Up @@ -18,7 +18,6 @@

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;
Expand Down Expand Up @@ -233,14 +232,10 @@ public void update(NutchDocument doc) throws IOException {
}
}

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 {
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/apache/nutch/indexer/IndexerOutputFormat.java
Expand Up @@ -54,7 +54,7 @@ public void write(Text key, NutchIndexAction indexAction)
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());
}
}
};
Expand Down

0 comments on commit 2999e14

Please sign in to comment.