parametrized logging
Project: http://git-wip-us.apache.org/repos/asf/nutch/repo Commit: http://git-wip-us.apache.org/repos/asf/nutch/commit/6155af68 Tree: http://git-wip-us.apache.org/repos/asf/nutch/tree/6155af68 Diff: http://git-wip-us.apache.org/repos/asf/nutch/diff/6155af68 Branch: refs/heads/2.x Commit: 6155af68943ead0fc808256d4a9a6acdca1d7c70 Parents: a62f742 Author: Pablo Torres <[email protected]> Authored: Wed Apr 13 12:13:09 2016 -0400 Committer: Pablo Torres <[email protected]> Committed: Wed Apr 13 12:13:09 2016 -0400 ---------------------------------------------------------------------- src/plugin/build.xml | 4 ++-- .../nutch/indexwriter/elastic2/ElasticIndexWriter.java | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nutch/blob/6155af68/src/plugin/build.xml ---------------------------------------------------------------------- diff --git a/src/plugin/build.xml b/src/plugin/build.xml index 47f4714..1c30a41 100755 --- a/src/plugin/build.xml +++ b/src/plugin/build.xml @@ -33,7 +33,7 @@ <ant dir="index-more" target="deploy"/> <ant dir="index-metadata" target="deploy"/> <ant dir="indexer-solr" target="deploy"/> - <ant dir="indexer-elastic" target="deploy"/> + <!--<ant dir="indexer-elastic" target="deploy"/>--> <ant dir="indexer-elastic2" target="deploy"/> <ant dir="language-identifier" target="deploy"/> <ant dir="lib-http" target="deploy"/> @@ -122,7 +122,7 @@ <ant dir="index-more" target="clean"/> <ant dir="index-metadata" target="clean"/> <ant dir="indexer-solr" target="clean"/> - <ant dir="indexer-elastic" target="clean"/> + <!--<ant dir="indexer-elastic" target="clean"/>--> <ant dir="indexer-elastic2" target="clean"/> <ant dir="language-identifier" target="clean"/> <ant dir="lib-http" target="clean"/> http://git-wip-us.apache.org/repos/asf/nutch/blob/6155af68/src/plugin/indexer-elastic2/src/java/org/apache/nutch/indexwriter/elastic2/ElasticIndexWriter.java ---------------------------------------------------------------------- diff --git a/src/plugin/indexer-elastic2/src/java/org/apache/nutch/indexwriter/elastic2/ElasticIndexWriter.java b/src/plugin/indexer-elastic2/src/java/org/apache/nutch/indexwriter/elastic2/ElasticIndexWriter.java index f51e3a8..8b413d7 100644 --- a/src/plugin/indexer-elastic2/src/java/org/apache/nutch/indexwriter/elastic2/ElasticIndexWriter.java +++ b/src/plugin/indexer-elastic2/src/java/org/apache/nutch/indexwriter/elastic2/ElasticIndexWriter.java @@ -149,9 +149,8 @@ public class ElasticIndexWriter implements IndexWriter { bulkDocs++; if (bulkDocs >= maxBulkDocs || bulkLength >= maxBulkLength) { - LOG.info("Processing bulk request [docs = " + bulkDocs + ", length = " - + bulkLength + ", total docs = " + indexedDocs - + ", last doc in bulk = '" + id + "']"); + LOG.info("Processing bulk request [docs = {}, length = {}, total docs = {}" + + ", last doc in bulk = '{}']", bulkDocs, bulkLength, indexedDocs, id ); // Flush the bulk of indexing requests createNewBulk = true; commit(); @@ -197,8 +196,8 @@ public class ElasticIndexWriter implements IndexWriter { } } long msWaited = System.currentTimeMillis() - beforeWait; - LOG.info("Previous took in ms " + actionGet.getTookInMillis() - + ", including wait " + msWaited); + LOG.info("Previous took in ms {}, including wait {}", + actionGet.getTookInMillis(), msWaited); execute = null; } if (bulk != null) { @@ -219,8 +218,8 @@ public class ElasticIndexWriter implements IndexWriter { @Override public void close() throws IOException { // Flush pending requests - LOG.info("Processing remaining requests [docs = " + bulkDocs - + ", length = " + bulkLength + ", total docs = " + indexedDocs + "]"); + LOG.info("Processing remaining requests [docs = {}, length = {}, total docs = {}]" + , bulkDocs, bulkLength, indexedDocs); createNewBulk = false; commit(); // flush one more time to finalize the last bulk
