Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

added description and default values

Ayal Ciobotarua4dd1f721692
diff --git a/conf/index-writers.xml.template b/conf/index-writers.xml.template
index e51db7c62..268554a09 100644
--- a/conf/index-writers.xml.template
+++ b/conf/index-writers.xml.template
@@ -164,11 +164,11 @@
<writer id="indexer_kafka_1" class="org.apache.nutch.indexwriter.kafka.KafkaIndexWriter">
<parameters>
<param name="host" value=""/>
- <param name="port" value=""/>
+ <param name="port" value="9092"/>
<param name="topic" value=""/>
- <param name="key.serializer" value=""/>
- <param name="value.serializer" value=""/>
- <param name="max.doc.count" value=""/>
+ <param name="key.serializer" value="org.apache.kafka.common.serialization.ByteArraySerializer"/>
+ <param name="value.serializer" value="org.apache.kafka.connect.json.JsonSerializer"/>
+ <param name="max.doc.count" value="100"/>
</parameters>
<mapping>
<copy>
diff --git a/src/plugin/indexer-kafka/src/java/org/apache/nutch/indexwriter/kafka/KafkaIndexWriter.java b/src/plugin/indexer-kafka/src/java/org/apache/nutch/indexwriter/kafka/KafkaIndexWriter.java
index 03f639c68..3cae454c9 100644
--- a/src/plugin/indexer-kafka/src/java/org/apache/nutch/indexwriter/kafka/KafkaIndexWriter.java
+++ b/src/plugin/indexer-kafka/src/java/org/apache/nutch/indexwriter/kafka/KafkaIndexWriter.java
@@ -186,6 +186,20 @@ public class KafkaIndexWriter implements IndexWriter {
"Default index to attach to documents",
this.topic));
+ properties.put(KafkaConstants.KEY_SERIALIZER,
+ new AbstractMap.SimpleEntry<>(
+ "instruct how to turn the key object the user provides with their ProducerRecord into bytes",
+ this.keySerializer));
+
+ properties.put(KafkaConstants.VALUE_SERIALIZER,
+ new AbstractMap.SimpleEntry<>(
+ "instruct how to turn the value object the user provides with their ProducerRecord into bytes",
+ this.valueSerializer));
+
+ properties.put(KafkaConstants.MAX_DOC_COUNT,
+ new AbstractMap.SimpleEntry<>(
+ "Maximum number of documents before a commit is forced",
+ this.maxDocCount));
return properties;
}