This is an automated email from the ASF dual-hosted git repository.
snagel pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/nutch.git
The following commit(s) were added to refs/heads/2.x by this push:
new cc2f4ab NUTCH-2469 Documents not commited to solr in Sever mode -
applied patch contributed by Ninaad Joshi
cc2f4ab is described below
commit cc2f4abeb7b8326acbb00f9d10b46a092bbbe9a5
Author: Sebastian Nagel <[email protected]>
AuthorDate: Tue Dec 5 12:41:05 2017 +0100
NUTCH-2469 Documents not commited to solr in Sever mode
- applied patch contributed by Ninaad Joshi
---
src/java/org/apache/nutch/indexer/IndexingJob.java | 31 +++++++++-------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/java/org/apache/nutch/indexer/IndexingJob.java
b/src/java/org/apache/nutch/indexer/IndexingJob.java
index bcac02b..f98d40d 100644
--- a/src/java/org/apache/nutch/indexer/IndexingJob.java
+++ b/src/java/org/apache/nutch/indexer/IndexingJob.java
@@ -136,6 +136,8 @@ public class IndexingJob extends NutchTool implements Tool {
@Override
public Map<String, Object> run(Map<String, Object> args) throws Exception {
+ LOG.info("IndexingJob: starting");
+
String batchId = (String) args.get(Nutch.ARG_BATCH);
Configuration conf = getConf();
@@ -155,6 +157,15 @@ public class IndexingJob extends NutchTool implements Tool
{
job.waitForCompletion(true);
ToolUtil.recordJobStatus(null, job, results);
+
+ IndexWriters writers = new IndexWriters(getConf());
+ LOG.info(writers.describe());
+
+ writers.open(getConf());
+ if (getConf().getBoolean(SolrConstants.COMMIT_INDEX, true)) {
+ writers.commit();
+ }
+ LOG.info("IndexingJob: done.");
return results;
}
@@ -172,24 +183,6 @@ public class IndexingJob extends NutchTool implements Tool
{
return filter;
}
- public void index(String batchId) throws Exception {
- LOG.info("IndexingJob: starting");
-
- run(ToolUtil.toArgMap(Nutch.ARG_BATCH, batchId));
- // NOW PASSED ON THE COMMAND LINE AS A HADOOP PARAM
- // do the commits once and for all the reducers in one go
- // getConf().set(SolrConstants.SERVER_URL,solrUrl);
-
- IndexWriters writers = new IndexWriters(getConf());
- LOG.info(writers.describe());
-
- writers.open(getConf());
- if (getConf().getBoolean(SolrConstants.COMMIT_INDEX, true)) {
- writers.commit();
- }
- LOG.info("IndexingJob: done.");
- }
-
public int run(String[] args) throws Exception {
if (args.length < 1) {
System.err
@@ -201,7 +194,7 @@ public class IndexingJob extends NutchTool implements Tool {
getConf().set(Nutch.CRAWL_ID_KEY, args[2]);
}
try {
- index(args[0]);
+ run(ToolUtil.toArgMap(Nutch.ARG_BATCH, args[0]));
return 0;
} catch (final Exception e) {
LOG.error("SolrIndexerJob: " + StringUtils.stringifyException(e));
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].